customers/account
The customers/account
template displays the customer account page, providing an overview of account information.
Location
The customers/account
template is in the theme's templates directory templates
> customers
:
└── theme
├── layout
├── templates
| └── customers
| ├── account.json
| ...
...
Content
You can include the customer object in the customers/account
template or in a section within the template.
The customer object
You can use the Handlebars customer object to display details on the page.
Usage
When using the customers/account
template, you should know how to:
- Display customer account information
- Show customer's address list
- Delete an address
- Deactivate account
If you use a JSON template, any HTML or Handlebars code needs to be included in the sections referenced by the template.
Display customer account information
You need to show the customer's account personal information. This can be accessed through the customer object:
Show customer's address list
You need to display the customer's address list and identify the default address. This can be accessed through the addresses
attribute of the customer object:
Delete an address
For each address, you should include an option to delete it. You can add this functionality with the following form:
You should combine the form above with JavaScript to prompt the customer to confirm the deletion before it is executed.
Deactivate account
When the merchant enables the "Allow customers to deactivate account" option in SHOPLINE Admin customer settings, you should include an option to deactivate the account. You can add this functionality with the following form and use loadFeatured
to include the customer-account-api
SDK for handling the logic of sending a verification code to the user's account:
For an example implementation, refer to the assets/section-main-account.js
and snippet/account-account.html
files in Seed.
Error loading component.