How To Modify The Customer Address Templates In Magento 2

Posted by

What is Customer Address Templates?

Customer Address Templates is the template that decides the format of customer billing and shipping addresses. This format displays on printed shipments, invoices, and refunds, as well as in the address book of the customer account. Store administrators can edit this template as they want.

Example 1: Text Templates

For Text, Text One Line, HTML and PDF Address Templates

{{depend address attribute code}} a space, a character, or UI label {{/depend}};

{{if address attribute code}}{{var address attribute code}} a space, a character, or UI label

{{/if}}

Example 2: JavaScript Template

For JavaScript Address Template

#{address attribute code} or User Interface label #{address attribute code}

Customer Address Templates Magento 2
Address Templates

To change the order of address fields:

 

  1. On the Admin sidebar, click Stores. After that below Settings, select Configuration.
  2. In the panel on the left, below Customers, select Customer Configuration.
  3. Open the Address Templates tab. The tab includes a different set of formatting instructions for each of the following:
  • Text
  • Text One Line
  • HTML
  • PDF
  1. Edit each template as you want, following the examples for reference.
  2. Click Save Config after completed.

Above is a describe the Customer Address Templates In Magento 2, and guidelines on how to change the order of address fields in Customer Address Field. We hope that you can find the way to edit the order of address fields as you want using this tutorial. If you have any question, feel free to leave a comment. Share this post if you think it is useful for Magento 2 store administrators. Don’t forget to subscribe Mageguides to read more Magento 2 guidelines post. In the next article, we will describe newsletters and how to configure them. Thanks for reading and see you in the next post.

 

Leave a Reply

Your email address will not be published. Required fields are marked *