customers/addresses
The customers/addresses
template renders the customer addresses page, which allows customers to view and manage their current addresses, as well as add new ones.
The customers/addresses
template is located in the templates
> customers
directory of the theme:
You should include the following in your customers/account
template or a section inside of the template:
The customer object
Anchor link to section titled "The customer object"You can access the Liquid customer
object to display the customer account details.
Standard form inputs
Anchor link to section titled "Standard form inputs"Inside forms for adding or editing an address, there are standard form inputs for each address detail. The table below shows each, with their associated type
and name
attributes.
Input | type |
name |
---|---|---|
First name | text |
address[first_name] |
Last name | text |
address[last_name] |
Company | text |
address[company] |
Address 1 | text |
address[address1] |
Address 2 | text |
address[address2] |
City | text |
address[city] |
Country | select |
address[country] |
Province | select |
address[province] |
ZIP/Postal Code | text |
address[zip] |
Phone Number | tel |
address[phone] |
When working with the customers/account
template, you should familiarize yourself with the following:
Add a new address
Anchor link to section titled "Add a new address"You can allow customers to add a new address with the Liquid form
tag and accompanying 'customer_address', customer.new_address
parameters:
Inside the form, you need to include the standard form inputs for capturing the various address details.
Edit an existing address
Anchor link to section titled "Edit an existing address"With each existing address, you should include a form to edit it. You can add this form with the Liquid form tag and accompanying 'customer_address', address
parameters:
Inside the form, you need to include the standard form inputs for capturing the various address details.
Delete an address
Anchor link to section titled "Delete an address"With each existing address, you should include the option to delete it. You can add this option by including the following form: