- Getting Started
- Liquid reference
- Filters reference
- Tags reference
- Localization
- Theme structure
- Theme sections
- Theme assets
- Theme config
- Theme layout
- Theme templates
-
- article.liquid
- blog.liquid
- cart.liquid
- collection.liquid
- customer/account.liquid
- customer/addresses.liquid
- customer/details.liquid
- customer/login.liquid
- customer/order.liquid
- customer/register.liquid
- customer/reset-password.liquid
- home.liquid
- page.no-heading.liquid
- products.liquid
- search.liquid
- list-collections.liquid
- store-locator.liquid
- 404.liquid
- customer/activate_account.liquid
- customer/orders.liquid
- Submission
customers/activate_account.liquid
The customers/activate_account.liquid template renders the form a customer uses to activate their account and set a password. It is loaded from the activation link sent to the customer, so the page has access to the activation token.
To activate an account, output the fields inside a <form> with the attributes action="/account/activate" and method="post". The form must include the CSRF token and the activation token as hidden inputs, and a password field for the customer to choose their password.
<form action="/account/activate" method="post">
<input type="hidden" name="_token" value="{% csrf %}">
<input type="hidden" name="activate_token" value="{{ token }}">
<input type="password" name="customer[password]" placeholder="{{ 'customer.activate_account.password' | t }}" required>
<button type="submit">{{ 'customer.activate_account.submit' | t }}</button>
</form>
Collecting customer details
You can collect the customer's profile at the same time by adding inputs named customer[first_name], customer[last_name], customer[gender] and customer[birthdate]. When the shop allows phone accounts, include a customer[email_or_phone] field so the customer can confirm the account they are activating.
<input type="text" name="customer[first_name]" placeholder="{{ 'customer.register.first_name' | t }}" required>
<input type="text" name="customer[last_name]" placeholder="{{ 'customer.register.last_name' | t }}" required>
form.errors
If the submission fails, the form object returns the validation errors. Output them with the default_errors filter so the customer can correct their input.
{% if form.errors %}
{{ form.errors | default_errors }}
{% endif %}