Magento 1 – E-Mail Template Variables for Taxvat

emailemail-templatesmagento-1template-directive

I need to add the taxvat id into the order confirmation E-Mail but I can´t get it to work.
There is a block
{{var order.getBillingAddress().format('html')}}
and I´ve added
<br/>{{var customer.taxvat}}
right after that.

I would need this taxvat id below the adress or somewhere in it but it doesnt seem to work this way. I´ve made sure there is an id registered within this account but I just can´t fetch it.

Someone in here who has done this before?

Best Answer

When an order is placed, a number of fields are copied from the quote and customer into the order. One of those fields comes from the quote, and is the associated customer's tax VAT ID.

To the point, you should be able to use this in your transactional e-mail templates:

{{var order.customer_taxvat}}

And that will give you what you're looking for. For some technical details, see app/code/core/Mage/Sales/etc/config.xml, ~line 186 and also some details about how fieldset copying works across entities:

https://stackoverflow.com/questions/19873431/what-is-fieldsets-in-magento-config-xml

Related Topic