Customer address templates
You can modify the template that controls the format of customer billing and shipping addresses that appear on printed invoices, shipments, and refunds, as well as in the addresses book of the customer account. If you want to include additional information, you can create custom attributes that are associated with the customer account and address, and incorporate them into the template.
Example 1: short format
For Text One Line address template:
{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}, {{var street}}, {{var city}}, {{var region}} {{var postcode}}, {{var country}}
Example 2: long format
For Text, HTML, and PDF address templates:
{{depend prefix}}{{var prefix}} {{/depend}}{{var firstname}} {{depend middlename}}{{var middlename}} {{/depend}}{{var lastname}}{{depend suffix}} {{var suffix}}{{/depend}}{{depend company}}{{var company}}{{/depend}}{{if street1}}{{var street1}}{{/if}}{{depend street2}}{{var street2}}{{/depend}}{{depend street3}}{{var street3}}{{/depend}}{{depend street4}}{{var street4}}{{/depend}}{{if city}}{{var city}}, {{/if}}{{if region}}{{var region}}, {{/if}}{{if postcode}}{{var postcode}}{{/if}}{{var country}}{{depend telephone}}T: {{var telephone}}{{/depend}}{{depend fax}}F: {{var fax}}{{/depend}}{{depend vat_id}}VAT: {{var vat_id}}{{/depend}}
{width="600" modal="regular"}
Change the order of address fields
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
In the left side panel, expand Customers and select Customer Configuration.
-
Click to expand the Address Templates section.
The section includes a separate set of formatting instructions for each of the following:
- Text
- Text One Line
- HTML
-
Edit each template as needed, using the examples for reference.
-
When complete, click Save Config.