Magento2 – Fix TypeError: Cart is Not a Function

cartknockoutjsmagento2.1.0

I ran into a issue where i could add products to cart and i got success message too but the minicart is not updating with the added items.

I got below error in console, I have upgraded the magento to 2.1.0

TypeError: cart is not a function in knockout.js

Did anyone came across this issue.

Best Answer

I have updated the bind events in the minicart file by comparing the base codes, once after update. It worked. Just compare the minicart.phtml file from theme

app\design\frontend\Theme_namespace\Theme_module\Magento_Ch‌​eckout\templates\car‌​t

with core template

vendor\magento\module-checkout\view\frontend\templates\cart‌

​In these two files class and bind events may be different in your theme, that is why it is not updating.

Related Topic