Following is my sales order email template sample,

Docroot = app\locale\en_US\template\email\sales\order_new.html

 <table cellpadding="0" cellspacing="0" border="0">
                    <td class="email-heading">
                        <h1>Thank you for your order from {{var store.getFrontendName()}}.</h1>     
                        <p>Once your package ships we will send an email with a link to track your order. Your order summary is below. Thank you again for your business.</p>
                    <td class="store-info">
                        <h4>Order Questions?</h4>
                            {{depend store_phone}}
                            <b>Call Us:</b>
                            <a href="tel:{{var phone}}">{{var store_phone}}</a><br>
                            {{depend store_hours}}
                            <span class="no-link">{{var store_hours}}</span><br>
                            {{depend store_email}}
                            <b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>

I just want to alter my thank you message based on the website in my multistore website.

If website id == 1 my message should be

<h1>Thank you for your order from {{var store.getFrontendName()}}.</h1>


<h1>Welcome our land your order from {{var store.getFrontendName()}}.</h1>

1 Answer 1


You can not use direct if condition like this

{{if order.websiteid == 1}}
 <p>Your text goes here</p>

But you can define the function or flag in your order model like this.

with function

public function shouldShowBlock() {
        /* your code to check website condition and return true or false */

and in email template

    {{if order.shouldShowBlock()}}
 <p>Your text goes here</p>

Just copy app/code/Mage/Sales/Model/Order.php to app/code/local/Mage/Sales/Model/Order.php then write you function to end of that file

  • may i know how to write order mode and where to write itl?
    – zus
    Mar 18, 2020 at 6:09
  • For your kind attention, i am using Magento version 1.9
    – zus
    Mar 18, 2020 at 6:29
  • ohh then you can get reference from here kiwee.eu/magento-how-to-override-core-model-class
    – Zahirabbas
    Mar 18, 2020 at 6:32
  • app\locale\en_US\template\email\sales how to take the model?
    – zus
    Mar 18, 2020 at 6:44
  • didn't get your above comment
    – Zahirabbas
    Mar 18, 2020 at 6:45

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.