Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Magento not picking up my theme template file for transactional email order?

I made some template changes to Magento's New Order transactional email template in the backend. The textual changes at the top of the email (in the "thanks for your order..." section) worked fine. But when I change the templates for the order details, they are not appearing in my email.

I have created two files within my template which I thought would override the email:

  1. app/design/frontend/default/mythemehere/template/email/order/items.phtml
  2. app/design/frontend/default/mythemehere/template/email/order/items/order/default.phtml

These are referenced in my sales.xml file in app/design/frontend/default/mythemehere/layout

<sales_email_order_items>
    <block type="sales/order_email_items" name="items" template="email/order/items.phtml">
        <action method="addItemRender"><type>default</type><block>sales/order_email_items_order_default</block><template>email/order/items/order/default.phtml</template></action>
        <action method="addItemRender"><type>grouped</type><block>sales/order_email_items_order_grouped</block><template>email/order/items/order/default.phtml</template></action>
        <block type="sales/order_totals" name="order_totals" template="sales/order/totals.phtml">
            <action method="setLabelProperties"><value>colspan="2" align="right" style="padding:3px 9px"</value></action>
            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
            <block type="tax/sales_order_tax" name="tax" template="tax/order/tax.phtml">
                <action method="setIsPlaneMode"><value>1</value></action>
            </block>
        </block>
    </block>
    <block type="core/text_list" name="additional.product.info" />
</sales_email_order_items>

However, when I place my order, I get the base template in the email.

If I commit the Cardinal Sin in Magento of overriding base template files (app/design/frontend/base/default/template/email/order ...), lo and behold, I see my changes! Seems Magento is very keen to use its base template.

I have overridden other templates in the sales section (eg: sales/order/view.phtml, sales/order/print.phtml), and various posts on Magento's forums indicate I'm doing the right thing in concept. But alas! It's just not working for me.

like image 273
ligos Avatar asked Oct 10 '22 12:10

ligos


1 Answers

To use your custom theme file for order email "app/design/frontend/default/mythemehere/template/email/order/items.phtml"

In the admin go to System->configuration->design

Select your website from the top left Now in the themes template uncheck the checkbok and add the theme name.

like image 72
Vineet Agarwal Avatar answered Oct 13 '22 11:10

Vineet Agarwal