Magento version: 2.0.0

How to add the product into shopping cart? How about this work-flow? and then, how to get the products of shopping cart?

  • Could you elaborate? Are you asking of js adding to cart or do you want programatically add item to the quote? What exactly is the problem?
    – Zefiryn
    Commented Mar 25, 2016 at 22:50

1 Answer 1


I use these code to get cart collection:

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$minicartModel= $objectManager->create('Magento\Checkout\Model\Cart');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.