Skip to content

customer-addresses ​

The customer-addresses template renders the addresses of the logged in customer.

Location ​

The customer-addresses template is located in the templates directory of the theme.

bash
└── theme
    ├── layout
    ├── templates
    │   ...
    │   ├── customer-addresses.json
    │   ...
    ...

Usage ​

It renders at /account/addresses. Without this template the store shows its built-in page. Visitors who are not logged in go to the login page.

Read the addresses from customer.addresses. Use the customer_address form to add or update an address, and the customer_address_remove form to remove one. After each post the customer comes back to this page.

liquid
{% for address in customer.addresses %}
  <p>{{ address.name }}, {{ address.address1 }}, {{ address.city }}, {{ address.country }}</p>
  {% if address.default %}<span>Default</span>{% endif %}

  {% form 'customer_address_remove', address %}
    <button type="submit">Remove</button>
  {% endform %}
{% endfor %}