I am customizing Magento's transactional emails and am trying to remove the Telephone/Fax from displaying in the email as they are displaying as:
T:-
F:-
The transactional mail template for new orders in the CMS is calling:
{{var order.getShippingAddress().format('html')}}
Which is defined in the top of the (cms based) email template as:
"var order.getShippingAddress().format('html')":"Shipping Address"
I don't quite understand what the purpose of this 'variable' definition is, but I also see no reference to this in the sales.xml
file.
Does anyone know how to adjust this html? Is there a clear methodology for finding where things are defined/pulled from in Magento? I am clearly confused coming from working primarily with WordPress theming.
—
Apologies for the endless string of transactional email questions. Hopefully this will help build the beta stack exchange as a valuable resource 🙂
Best Answer
Actually the variables defined at the top of the email are 'injected' when the template is called. In this case it's the
order
object.If you check out the file
app/code/core/Mage/Sales/Model/Order.php
you can find around the line 948 the methodgetShippingAddress
. This is the actual function you're referencing here.Now for the
format('html')
part, this is where you can actually start making some changes. And the best part is, no coding is required.Go to your backend
System > Configuration > Customer configuration > Addresslayout
and look for the fieldHTML
. By default it will look like this:As you can see removing telephone and fax altogether is just a matter of deleting the last 2 lines before the VAT line.