Magento – Minicart 2.1 Minicart doesn’t show products added to the cart

checkoutknockoutjsmagento-2.1magento2mini-cart

I'm working on a Magento 2.1 shop with a custom theme. When I use the blank theme, everything works just fine. The moment I enable my own theme, but without overwriting the minicart templates I have the following problem.

The item count in the minicart gets updated but overview of products in your cart is not there. Also the "Go to checkout"-"button and the "Close"-button of the minicart are not working anymore. This is what my console logs.

Unable to process binding "foreach: function (){return { data:getCartParam('items'),as:'item'} }"
Unable to process binding "foreach: function (){return { data:getCartParam('items'),as:'item'} }"
Unable to process binding "foreach: function (){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Cannot read property 'configurable' of undefined

It might be relevant to note that I moved the minicart in my default.xml file to another location, not sure if relevant.

Best Answer

Have you overridden or extended your minicart.js script?

2.1 introduced some changes to these files to resolve previous issues with the minicart values not updating on page load. Assuming you have overridden this file or extended some of its functions, you'll have to bring it in line with the changes that were introduced with 2.1.

Here's the commit with the relevant changes: https://github.com/magento/magento2/commit/eec3cf17bc5deae71c83c797d1339de46cf6905f Namely, cart() was replaced with call to new function getCartParam().

Hope this helps resolve your issue!

Related Topic