cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 Mini Cart is not working when changing the cart position

   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Magento 2 Mini Cart is not working when changing the cart position

The block i repositioned is given here. Its shows an error on console. The error is as follows. Anyone please help

 

Uncaught TypeError: Unable to process binding "if: function (){return cart().summary_count }"
Message: Unable to process binding "foreach: function (){return { data:cart().items,as:'item'} }"
Message: Unable to process binding "foreach: function (){return $parent.getRegion($parent.getItemRenderer(item.product_type)) }"
Message: Cannot read property 'simple' of undefined

 

 

<block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="logo" template="cart/minicart.phtml">
<arguments>
<argument name="jsLayout" xsi:type="array">
<item name="types" xsi:type="array"/>
<item name="components" xsi:type="array">
<item name="minicart_content" xsi:type="array">
<item name="component" xsi:type="string">Magento_Checkout/js/view/minicart</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Magento_Checkout/minicart/content</item>
</item>
<item name="children" xsi:type="array">
<item name="subtotal.container" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="config" xsi:type="array">
<item name="displayArea" xsi:type="string">subtotalContainer</item>
</item>
<item name="children" xsi:type="array">
<item name="subtotal" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="config" xsi:type="array">
<item name="template" xsi:type="string">Magento_Checkout/minicart/subtotal</item>
</item>
</item>
</item>
</item>
<item name="extra_info" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="config" xsi:type="array">
<item name="displayArea" xsi:type="string">extraInfo</item>
</item>
</item>
<item name="promotion" xsi:type="array">
<item name="component" xsi:type="string">uiComponent</item>
<item name="config" xsi:type="array">
<item name="displayArea" xsi:type="string">promotion</item>
</item>
</item>
</item>
</item>
</item>
</argument>
</arguments>
</block>

 

 

6 REPLIES 6

Re: Magento 2 Mini Cart is not working when changing the cart position

I'm having the same issue, did you (or anyone else) find a solution for this problem?

Re: Magento 2 Mini Cart is not working when changing the cart position

Me too. Has the problem been solved?

Re: Magento 2 Mini Cart is not working when changing the cart position

Me too having the same issue. Any fixes??

Re: Magento 2 Mini Cart is not working when changing the cart position

Hi,

 

I have successfully fixed this issue in my project. 

Previously, I did some overriding with default layout xml file in checkout module for customising minicart. But, then I removed that.

And in the default layout xml file in theme module, I called the "header-wrapper" container, without overriding this.

 

<referenceContainer name="header-wrapper">

<!-- added some extra static block -->

<block class="Magento\Cms\Block\Block" name="block_identifier" after="-">
<arguments>
<argument name="block_id" xsi:type="string">header-menu</argument>
</arguments>
</block>

</referenceContainer>

 

Minicart is contained by this "header-wrapper". So if you re-declare it in your theme, it causes error. You just need to call it.

 

This idea worked for me.

 

Thanks.

Re: Magento 2 Mini Cart is not working when changing the cart position

Can you share your whole code here? I know it's been two years but still if possible please do share your code.

Re: Magento 2 Mini Cart is not working when changing the cart position

This is work for me too. Thank you


@prithweemad wrote:

Hi,

 

I have successfully fixed this issue in my project. 

Previously, I did some overriding with default layout xml file in checkout module for customising minicart. But, then I removed that.

And in the default layout xml file in theme module, I called the "header-wrapper" container, without overriding this.

 

<referenceContainer name="header-wrapper">

<!-- added some extra static block -->

<block class="Magento\Cms\Block\Block" name="block_identifier" after="-">
<arguments>
<argument name="block_id" xsi:type="string">header-menu</argument>
</arguments>
</block>

</referenceContainer>

 

Minicart is contained by this "header-wrapper". So if you re-declare it in your theme, it causes error. You just need to call it.

 

This idea worked for me.

 

Thanks.


This is work for me too. thank you Smiley Happy