I need to display a custom template inside the mini cart, after the subtotal and above the buttons (view all and proceed to checkout). I have my template in /template/mymodule/mytemplate.phtml wich for the moment has only a p tag with 'test' written in it. Then I edited my local.xml to include my template. If I write:

<reference name="content"><block type="core/template" name="myname" as="myalias" template="mymodule/mytemplate.phtml" before="-" /></reference>

the block is correctly shown at the beginning of the content. But if I change the reference with

<reference name="cart_sidebar"> 

nothing is shown in the mini cart.

So, what do I have to reference in local.xml to have my template displayed inside the mini cart?

  • are you using rwd theme ? Aug 30 '16 at 11:16
  • No, I'm using a custom theme. I know that the rwd theme has a 'promotions' block inside the mini-cart and I can replicate it in my custom theme but to do so I have to edit the mini-cart phtml and insert the promotions block by the getChildHtml fx. I'd like to avoid editing of the template and use only my local.xml to inject my template inside the mini-cart, if that is possible
    – Lounik
    Aug 31 '16 at 12:36
  • no, you can't insert template BETWEEN subtotal and checkout button. You have to override mini-cart phtml and use getChildHtml. But this is normal, no idea why you don't want to override Aug 31 '16 at 12:57
  • I prefer not to override templates if it isn't absolutely necessary. It's just a personal choice to do things, no real reason. I'll override the template, then, thanks
    – Lounik
    Sep 1 '16 at 7:02
  • Yes, you are right, I can provide you the code, if you want Sep 1 '16 at 7:31

Try this:

<reference name="cart_sidebar">
    <action method="setTemplate"><file>my_template/file.phtml</file></action>
  • Thanks, I tried but it doesn't work
    – Lounik
    Aug 31 '16 at 12:36
  • any update on this? were u able to add in minicart?
    – Sushivam
    May 23 '17 at 9:57
  • Not really, unfortunately, I ended up overriding the mini-cart template with my own, sorry
    – Lounik
    Feb 21 '18 at 7:42
  • how did you override ..please explain.. Sep 18 '18 at 3:53

Override following file in your theme


Add following code in tag.

<referenceContainer name="header-wrapper">
   <referenceBlock name="minicart">
        <block type="core/template" name="myname" as="myalias" template="mymodule/mytemplate.phtml" before="-" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.