0

I have a Magento 2 Installation in which everything appears to be working fine except products will not add to the cart. The add to cart button appears to do nothing at all. I am getting the following error in console from knockout.js file line:3012

Uncaught TypeError: Unable to process binding "css: function (){return { empty:cart().summary_count == 0} }"
Message: cart is not a function

Has anyone experienced anything similar? I cannot find any documentation on similar issues with Magento2.

Thanks

3
  • 2
    Hi Daniel, do you have customizations, css changes, js changes? Do you use development mode? Please clarify. thanks
    – Max Pronko
    Commented Jan 15, 2016 at 19:26
  • What's the version of magento you use? Did you have magento 2 previously installed on this domain? Did you clear browser cache?
    – Anton Kril
    Commented Jan 16, 2016 at 9:28
  • @MaxPronko Yes! A piece of JavaScript in a custom theme was causing the issue. Thanks.
    – Daniel
    Commented Jan 18, 2016 at 16:32

1 Answer 1

0

This was solved. Some unknown JavaScript in a custom theme was clashing with some part of the Add to Cart process. I reverted to a default theme and the issue was resolved.

2
  • Its been a while, but could you clarify which JS exactly destroyed knockout.js? Am having the same issue and struggeling to find that JS code.
    – Max
    Commented Sep 13, 2016 at 8:44
  • @Max Apologies Max, but I don't remember. It was nothing within an existing Magento theme, only some minor functionality I had implemented to show/hide elements if I remember correctly. Be sure to use .noConflict. Good luck!
    – Daniel
    Commented Sep 14, 2016 at 12:13

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.