cancel
Showing results for 
Search instead for 
Did you mean: 

How to override mini-cart default item template? (is loaded via JS)

How to override mini-cart default item template? (is loaded via JS)

Hi guys,

 

We're in the process of building our own theme based on the Magento Blank theme and we would like to implement 2 small changes to the minicart dropdown in the header. These files are loaded through JS I think, but simply duplicating the file to our own theme in the same folder (Name/name2/web/template/minicart/item/default.html) and editing them doesn't show up any changes so we suspect the override behaviour is different in this case.

Can you point us in the right direction? Thanks!

2 REPLIES

Re: How to override mini-cart default item template? (is loaded via JS)

Hi Klaus,

 

here's the Feedback as requested:

 

"Name/name2/web/template/minicart/item/default.html" is a wrong path for this template. To override the default template, the new file should be placed to: "/app/design/frontend/<Vendor>/<theme>/Magento_Checkout/web/template/minicart/item/default.html"

 

Credits to Olga Matviienko :-)

 

Best,

 Rico

--
Co-Founder of Buro 71a, Teaching for Magento U, Help the German Community grow

Re: How to override mini-cart default item template? (is loaded via JS)

<reference name="header">

<block type="checkout/cart_minicart" name="minicart_head" template="checkout/cart/minicart.phtml" before="-">

<block type="checkout/cart_sidebar" name="minicart_content" template="checkout/cart/minicart/items.phtml">

<action method="addItemRender"><type>default</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>

<action method="addItemRender"><type>simple</type><block>checkout/cart_item_renderer</block><template>checkout/cart/minicart/default.phtml</template></action>

<action method="addItemRender"><type>grouped</type><block>checkout/cart_item_renderer_grouped</block><template>checkout/cart/minicart/default.phtml</template></action>

<action method="addItemRender"><type>configurable</type><block>checkout/cart_item_renderer_configurable</block><template>checkout/cart/minicart/default.phtml</template></action>

 

<block type="core/text_list" name="cart_sidebar.cart_promotion" as="cart_promotion" translate="label" module="checkout">

<label>Mini-cart promotion block</label>

</block>

<block type="core/text_list" name="cart_sidebar.extra_actions" as="extra_actions" translate="label" module="checkout">

<label>Shopping Cart Sidebar Extra Actions</label>

</block>

</block>

</block>

</reference>

 

http://www.traininginsholinganallur.in/oracle-training-in-chennai.html