Magento 2.3.4 minicart not working only on product detail page

452 Views Asked by At

I have added a minicart on the header of my custom theme. The issue is that the items added to the cart only show on the product detail page. On other pages, the minicart dropdown only shows the checkout button. There is some error in the console.

    Uncaught TypeError: Unable to process binding "if: function(){return getCartParam('summary_count') }"
Message: Unable to process binding "foreach: function(){return { data:getCartItems(),as:'item'} }"
Message: Unable to process binding "foreach: function(){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Message: Cannot read properties of undefined (reading 'configurable')
    at UiClass.getItemRenderer (minicart.js:145:37)
    at foreach (eval at createBindingsStringEvaluator (knockout.js:2982:16), <anonymous>:3:93)
    at knockout.js:4271:30
    at Object.init (knockout.js:5454:58)
    at init (knockout.js:4296:54)
    at knockout.js:3358:46
    at Object.ignore (knockout.js:1470:33)
    at knockout.js:3357:48
    at Object.arrayForEach (knockout.js:159:17)
    at applyBindingsToNodeInternal (knockout.js:3343:22)

Please help.

1

There are 1 best solutions below

0
Nathan Fisher On

Im not a magento dev, but it appears that the function function(){return $parent.getRegion($parent.getItemRenderer(item.product_type)) } is returning undefined for a particular item. Somewhere in the $parent.getRegion($parent.getItemRenderer(item.product_type)) call chain is your issue.

It could be

  • item.product_type value
  • $parent.getItemRenderer return value

There is an issue with the $parent.getRegion return value

    Uncaught TypeError: Unable to process binding "if: function(){return getCartParam('summary_count') }"
Message: Unable to process binding "foreach: function(){return { data:getCartItems(),as:'item'} }"
Message: Unable to process binding "foreach: function(){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Message: Cannot read properties of undefined (reading 'configurable')

Hope that helps.