Question

I want to insert custom text in email template, if shipping title = 'Pickup'. I have followed this guide to make if statement work in mail template. https://stackoverflow.com/questions/4797394/magento-email-template-if-statements

  1. I have inserted this in mail template.

    {{block type='core/template' area='frontend' template='email/shippingmail.phtml' order=$order}}
    
  2. I have created new phtml file called shippingmail.phtml with this code

    if ($this->getData('order')->getShippingDescription()=='Pickup') {
    echo nl2br(Mage::getStoreConfig('general/store_information/address')); }
    

But for some reason i can not make it show my store address i mail if shipping description is 'Pickup'.

What am i missing here?

Was it helpful?

Solution

I found out problem.

I had placed custom mail block "shippingmail.phtml" under my custom template.

Once i changed this this to default template it worked

Ie.

app/design/frontend/default/MYCUSTOMTHEME/template/email/shippingmail.phtml

Changed to this:

app/design/frontend/default/default/template/email/shippingmail.phtml
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top