0

I would like to override this file in my module but cannot find the reference name for

base/default/template/email/order/shipment/track.phtml

<layout version="0.1.0">
    <????>
        <reference name="????">
            <action method="setTemplate">
                <template>namespace/email/order/shipment/track.phtml</template>
           </action>
        </reference>
    </????>
</layout>

what should i be replacing the question marks with?

3 Answers 3

1

This template email/order/shipment/track.phtml is used directly in email (app/locale/en_US/template/email/sales/shipment_new.html & app/locale/en_US/template/email/sales/shipment_new_guest.html). {{block type='core/template' area='frontend' template='email/order/shipment/track.phtml' shipment=$shipment order=$order}}

So you can't use layout to change this template. You need to create a transactional email to change this template.

Hope this help,

6
  • I want this to be in a module that i can place on any site and it will change the email template I dont think your idea would be able to do that Nov 30, 2015 at 14:38
  • 1
    no other method that I know (@SeStro and mine). So, you can do : rewrite core/template and if the template is email/order/shipment/track.phtml change it by your own. It works but this is a very dirty code
    – bchatard
    Nov 30, 2015 at 16:42
  • i dont mind dirty, but i am a beginner how would i do the rewrite core/template ? Nov 30, 2015 at 22:02
  • how do I rewrite core/template Dec 1, 2015 at 20:11
  • If you want to do a module for the community, so do not think like this. Clean code is important. Your module need to create a transactional email with the good template. If not, the solution from @SeStro or mine is the only way to do that.
    – bchatard
    Dec 1, 2015 at 23:11
0

Just create file in [your_package]/[your_theme]/template/email/order/shipment/track.phtml

1
  • I want this to be in a module that i can place on any site and it will change the email template I dont think your idea would be able to do that Nov 30, 2015 at 14:38
0

ok i figured out I added to mmy modules config

<global>
    <template>
        <email>
            <sales_email_shipment_template translate="label" module="sales">
                <label>New Shipment</label>
                <file>sales/[namespace]/shipment_new.html</file>
                <type>html</type>
            </sales_email_shipment_template>
            <sales_email_shipment_guest_template translate="label" module="sales">
                <label>New Shipment for Guest</label>
                <file>sales/[namespace]/shipment_new_guest.html</file>
                <type>html</type>
            </sales_email_shipment_guest_template>
        </email>
    </template>
</global>

and then copied the core files to my namespace and edited the block that called track.phtml to call my custom module

Thanks for all the help!

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.