3

When I add new product to cart. It is adding that products to cart but mini cart doesn't shows anything. and my console has following error.

TypeError: this.itemRenderer is undefined

can anyone tell what is because of this.

2

3 Answers 3

1

I think you changed the block from 'minicart' to a another block.
Please make sure that the checkout_cart_sidebar_item_renderers.xml
(vendor/magento/module-checkout/view/frontend/layout/checkout_cart_sidebar_item_renderers.xml)
have the same block, in which the 'itemRenderer' was set.

2
  • I m not getting your answer.. can you please tell me in details??
    – Asish Hira
    Commented Mar 28, 2016 at 6:00
  • @AsishHira , Did you get any solution for that ? Commented Dec 18, 2017 at 13:26
1

I think you should add this.

<item name="config" xsi:type="array">
    <item name="itemRenderer" xsi:type="array">
        <item name="default" xsi:type="string">defaultRenderer</item>
        <item name="simple" xsi:type="string">defaultRenderer</item>
        <item name="virtual" xsi:type="string">defaultRenderer</item>
    </item>
</item>

Inside your <item name="minicart_content" xsi:type="array"> tag it will remove this error.

There us another way you can add minicart to desired block by just moving minicart block using this.

<move element="minicart" destination="your.container.name" />

This way you don't need to add missing arguments, I hope this will help you somehow.

0

Try to delete Magento_Checkout/layout folder from your theme.

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.