2

I'm getting issues with the Order Summary on the checkout of my magento2 site.

No products or information about the order is being displayed at all and in console I get a knockoutjs error which I'm struggling to see how it helps.

Uncaught ReferenceError: Unable to process binding "if: function (){return maxCartItemsToDisplay < getCartLineItemsCount() }"

Message: maxCartItemsToDisplay is not defined at if (eval at createBindingsStringEvaluator (knockout.js:2624), :3:55) at ko.computed.disposeWhenNodeIsRemoved (knockout.js:3989) at evaluateImmediate (knockout.js:1737) at Object.ko.computed.ko.dependentObservable (knockout.js:1946) at init (knockout.js:3988) at knockout.js:2989 at Object.ignore (knockout.js:1249) at knockout.js:2988 at Object.arrayForEach (knockout.js:151) at applyBindingsToNodeInternal (knockout.js:2974)

Any help with this or how to debug this would be appreciated.

  • 1
    Have you made any changes to the templates? The majority of cases I've seen this error it has been when someone has removed something in the template, such as the scope attribute. – Ben Crook Aug 23 '17 at 16:51
  • Unfortunately it's not my project so I'm not entirely sure. By template, are you referring to the html file? – ol'bob dole Aug 23 '17 at 18:05
  • Yeah, if they're overwriting default templates try and revert them back to default and see if it works. If it does you know the problem is in the template. – Ben Crook Aug 24 '17 at 8:31
  • I've got an overwritten cart-items.js in my theme files. I'm going to remove that and see if that helps, as there isn't any .html files there. – ol'bob dole Aug 24 '17 at 10:09
  • Latest version of the Porto theme 2.6.1 from Smartwave has this issue. Have reported to them to address. Struggling to make this fix work in our install.... – MagentoMac Oct 24 '17 at 23:06
2

Recently I've updated magento with 2.1.8 version and got the same issue. maxCartItemsToDisplay variable was added in the new version and is used in the next files

vendor/magento/module-checkout/Model/Cart/CheckoutSummaryConfigProvider.php
vendor/magento/module-checkout/view/frontend/web/js/view/summary/cart-items.js
vendor/magento/module-checkout/view/frontend/web/template/summary/cart-items.html

If you rewrite some of these files you can get an error with summary block on checkout. In my case cart-items.js has been rewritten by Smartwave theme, so I just added the changes to it.

I hope this will be useful to you.

  • Hi, thanks for replying - you mention those three files, but what do I need to do to resolve the error? – ol'bob dole Sep 19 '17 at 19:23
  • Hi, I've just merged functionality from the new cart-tems.js with cart-items.js from theme. – Alona Tsarova Oct 3 '17 at 14:42
  • Latest version of the Porto theme 2.6.1 from Smartwave has this issue. Have reported to them to address. Struggling to make this fix work in our install.... – MagentoMac Oct 24 '17 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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