Skip to main content

customers/account

The customers/account template renders the customer account page, which provides an overview of the customer’s account.

Tip

Refer to the customers/account template and its main section in Dawn for an example implementation.

An example of the customers/account template in Dawn

The customers/account template is located in the templates > customers directory of the theme:

└── theme
├── layout
├── templates
| └── customers
| ├── account.json
| ...
...

You should include the customer object in your customers/account template or a section inside of the template.

You can access the Liquid customer object to display the customer account details.


When working with the customers/account template, you should familiarize yourself with the following:

Tip

If you're using a JSON template, then any HTML or Liquid code needs to be included in a section that's referenced by the template.

Anchor to Show the customer’s ordersShow the customer’s orders

You should show customers a list of their orders. These can be accessed through the order attribute of the customer object, and have a limit of 20 per page. For this reason, you should paginate orders to ensure that they’re all accessible:

Example

{% paginate customer.orders by 10 %}
{% for order in customer.orders %}
<!-- order info -->
{% endfor %}

{{ paginate | default_pagination }}
{% endpaginate %}

Anchor to Show the customer’s default addressShow the customer’s default address

You should show customers their default address. This can be accessed through the default_address attribute of the customer object:

Example

{% if customer.default_address %}
<p>{{ customer.default_address.address1 }}</p>

{% if customer.default_address.address2 != blank %}
<p>{{ customer.default_address.address2 }}</p>
{% endif %}

<p>{{ customer.default_address.city }}, {% if customer.default_address.province_code %}{{ customer.default_address.province_code }}{% endif %}, {{ customer.default_address.country_code }}
<p>{{ customer.default_address.zip_code }}</p>
<p>{{ customer.default_address.phone }}</p>
{% endif %}

Was this page helpful?