Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $objectManager = MagentoFrameworkAppObjectManager::getInstance();
- $cart = $objectManager->get('MagentoCheckoutModelCart');
- // retrieve quote items collection
- $itemsCollection = $cart->getQuote()->getItemsCollection();
- // get array of all items what can be display directly
- $itemsVisible = $cart->getQuote()->getAllVisibleItems();
- // retrieve quote items array
- $items = $cart->getQuote()->getAllItems();
- foreach($items as $item) {// product id
- $it[] = $item->getProductId();
- }
- if (in_array(483, $it)){
- //What logic to make here?
- }
Add Comment
Please, Sign In to add comment