Guest User

Untitled

a guest
Jan 23rd, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. $objectManager = MagentoFrameworkAppObjectManager::getInstance();
  2. $cart = $objectManager->get('MagentoCheckoutModelCart');
  3.  
  4. // retrieve quote items collection
  5. $itemsCollection = $cart->getQuote()->getItemsCollection();
  6.  
  7. // get array of all items what can be display directly
  8. $itemsVisible = $cart->getQuote()->getAllVisibleItems();
  9.  
  10. // retrieve quote items array
  11. $items = $cart->getQuote()->getAllItems();
  12.  
  13. foreach($items as $item) {// product id
  14. $it[] = $item->getProductId();
  15. }
  16. if (in_array(483, $it)){
  17. //What logic to make here?
  18. }
Add Comment
Please, Sign In to add comment