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.
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.
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.
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.