4

I have made a test putting the var {{var payment_html}} inside the email template order_update.html however when Magento sends an email using this template, any payment information is printed on the box "Payment Details". After that, I searched about it and I found out on this link that some variables don't make effect for some templates. I would like to know if is possible to show off the payment details on the order update email template.

Does anybody have idea about how to do that?

2
  • Adding variables to emails is afaik still a big problem, because there is no event to listen on. But there are extensions which rewrites the class and add an event, so you can listen and add whatever you want, for example payment information :-) Feb 23, 2013 at 8:11
  • Did you found an answer? Rewrote the mail Sending? Have a look on this pull request, it will be added to the mailing in 1.8 (next week hopefully). It might help you Apr 7, 2013 at 0:20

2 Answers 2

2

Var $payment_html is injected in email variables in Mage_Sales_Model_Order::sendNewOrderEmail() and not available for update emails. Since exact block wich is rendered depends on payment method you will need to get that HTML using same way as in Mage_Sales_Model_Order::sendNewOrderEmail(). You can either extend and overwrite Mage_Sales_Model_Order::sendNewOrderEmail() or create your own block and reference it in the email template.

{{block type="your/block_type"}}

The only problem is how to pass order to your block. I am not sure if var order will work in this context.

3
  • Right, but how can I create my own block, in this case? What steps would I have to follow to do that? Feb 22, 2013 at 18:34
  • You would typically add a custom module in which you create the block. For small changes you could override some of the existing blocks in local, but this is not recommended way to do it. Feb 22, 2013 at 18:44
  • If this feature will really be added on 1.8 it will be cool, I hope. I opened this topic just because a request that I received from a customer of the agency where I work. Some people doesn't have what to do in their lives besides traveling and annoying who has work to do, that's the case of "my" customer. Thanks for help. Apr 7, 2013 at 20:55
0

go to the base code for that:

app/design/adminhtml/default/default/template/payment/info/pdf/(in my case is defalut.phtml but is possible you use other, test all files)

dow to this line

echo $this->escapeHtml($this->getMethod()->getTitle())

write

echo $this->escapeHtml($this->getMethod()->getInstructions());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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