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 %}
			
icon-accounticon-add-newicon-add-storeicon-appicon-appleicon-archiveicon-arrowdownicon-ascicon-bookicon-cancelicon-cart-addonicon-checkouticon-cherryicon-collectionicon-comfirmicon-confirmicon-couponicon-creditsicon-currencyicon-dashboardicon-discounticon-disintegrateicon-domainicon-dscicon-duplicateicon-editicon-emailicon-exclamation-triangleicon-exporticon-eyeicon-eye-slashicon-fullscreenicon-fullscreen-closeicon-generalicon-gifticon-gridicon-hddicon-helpicon-importicon-infoicon-integrationicon-invoiceicon-likeicon-listicon-locationicon-logouticon-new-tabicon-not-secureicon-optionicon-ordericon-outline-arrowdownicon-pageicon-paymenticon-plusicon-posicon-pricingicon-printericon-producticon-product-sumicon-product-sum-xicon-redirecticon-reporticon-reseticon-searchicon-secureicon-settingicon-shippingicon-staricon-storeicon-switch-storeicon-tagicon-taxesicon-templateicon-themeicon-tickicon-trashicon-unarchiveicon-uploadicon-user-tagicon-usersicon-weighticon-wholesale