Feature request from Vinai, posted on GitHub Apr 21, 2016
Steps to reproduce
- Create a class with a dependency on
- Add a product to the cart
- Execute the code within the same session
CartInterface instance represents the current quote
\Magento\Quote\Api\Data\CartInterface::getItems returns the items in the cart
CartInterface instance is empty.
To retrieve the current quote items
\Magento\Checkout\Model\Session::getQuote() has to be used.
This is problematic since neither
\Magento\Quote\Model\Quote are blessed with the
The alternative would be to use
\Magento\Quote\Api\CartManagementInterface::getCartForCustomer, but for guests that would require having the masked cart id.
It is quite common for customizations to require access to the current cart contents. It would be nice if that could be handled with a simple dependency on