0

I want to get categories details like name and id from the product item which are added the in cart.

please help out in getting data of checkout cart product and i want to use it in my custom module every time i try to getting data it gives me null by using

$this->_cart->getQuote()->getItemsCollection();
  • Try using $this->_cart->getQuote()->getAllItems();. – Dhaduk Mitesh Nov 8 at 11:23
  • Try but getting null – Muhammad Adeel Nov 8 at 11:30
  • getAllVisibleItems() might get you what you need – vitoriodachef Nov 8 at 11:58
  • do this one also – Muhammad Adeel Nov 8 at 12:01
  • $this->create('\Magento\Framework\ObjectManagerInterface')->create('\Magento\Checkout\Model\Session')->getQuote()->getAllItems(); try this. – Dhaduk Mitesh Nov 8 at 12:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.