Liqiud basics
Modules
API
Mailer
Customer templates
On this page
Overview
There are many different kind of customer templates that you in most cases need if you want your customers to be available to create an account in your webshop or webpage.
All of the customer templates is webshop templates and therefore should they be named customer.lost_password.ws, customer.invitation.ws etc.
customer.lost_password
This is the template where the user request a new password by entering their email address.
Standard form for lost password
{% wm3form customer.lost_password_url %}
<input name="customer[email]" type="email" required>
{% endwm3form %}
customer.reset_password
This is the template where the user has reveiced an email with a link to a page where they can choose a new password.
Standard form for reset password
{% wm3form customer.reset_password_url %}
<input name="customer[password]" type="password" required>
<input name="customer[password_confirmation]" type="password" required>
{% endwm3form %}
customer.invitation
Customer invitation is not a required template. You only need to create this template if the webpage or webshop wants to be able to send invites to people and as if they want to create an account on their site.
If an email is being sent the person will recieve an email with a link to a "Create account"-page. On this page the user needs to select a password.
Standard form for customer invitation
{% wm3form customer.invitation_url %}
<input name="customer[password]" type="password" required>
<input name="customer[password_confirmation]" type="password" required>
{% endwm3form %}
customer.login
This template is the login page for the customer. Here the customer enters their email and password to get access to the site.
Standard form for customer login
{% wm3form customer.login_url %}
<input name="customer[email]" type="email" required>
<input name="customer[password]" type="password" required>
{% endwm3form %}
Redirect form for customer login
Use a redirect if you want the user to land on a specific page after successful login
{% wm3form customer.login_url %}
<input name="customer[email]" type="email" required>
<input name="customer[password]" type="password" required>
<input type="hidden" name="redirect_to" value="/page-url" />
{% endwm3form %}
customer.register
Customer register is not a required template. You only need to create this template if the webpage or webshop wants users to be able to, on their own, create an account on the site.
If the page is a webshop you will need a ton of input fields to tell billing and shipping address. More on this on Webshop addresses
From customer register you also have access to notifications and error messages.
Standard form for customer register
{% wm3form customer.register_url %}
<input name="customer[email]" type="email" required>
<input name="customer[password]" type="password" required>
<input name="customer[password_confirmation]" type="password" required>
{% endwm3form %}
Customer registration form with all types of information
{% wm3form customer.register_url %}
<input name="customer[email]" type="email" required>
<input name="customer[first_name]" type="text">
<input name="customer[last_name]" type="text">
<input name="customer[company]" type="text">
<input name="customer[organisation_number]" type="text">
<input name="customer[phone]" type="text">
<input name="customer[alternative_phone]" type="text">
<input name="customer[password]" type="password" required="required">
<input name="customer[password_confirmation]" type="password" required="required">
<h3>Bill address</h3>
<input name="customer[bill_address_attributes][first_name]" type="text">
<input name="customer[bill_address_attributes][last_name]" type="text">
<input name="customer[bill_address_attributes][company]" type="text">
<input name="customer[bill_address_attributes][address1]" type="text">
<input name="customer[bill_address_attributes][address2]" type="text">
<input name="customer[bill_address_attributes][city]" type="text">
<input name="customer[bill_address_attributes][zipcode]" type="text">
<input name="customer[bill_address_attributes][state_name]" type="text">
<input name="customer[bill_address_attributes][phone]" type="tel">
<input name="customer[bill_address_attributes][ssnr]" type="tel">
<input name="customer[bill_address_attributes][organisation_number]" type="tel">
<select name="customer[bill_address_attributes][country_id]" required="required">
{% for country in store.countries %}
<option value="{{ country.id }}">{{ country.name }}</option>
{% endfor %}
</select>
<!-- If value is "1" or "true" here the code will ignore the shipping adress and instead use the
billing address as shipping address -->
<p>Use bill address as ship address</p>
<input name="customer[use_bill_address]" type="text" value="1">
<h3>Shipping address</h3>
<input name="customer[ship_address_attributes][first_name]" type="text">
<input name="customer[ship_address_attributes][last_name]" type="text">
<input name="customer[ship_address_attributes][company]" type="text">
<input name="customer[ship_address_attributes][address1]" type="text">
<input name="customer[ship_address_attributes][address2]" type="text">
<input name="customer[ship_address_attributes][city]" type="text">
<input name="customer[ship_address_attributes][zipcode]" type="text">
<input name="customer[ship_address_attributes][state_name]" type="text">
<input name="customer[ship_address_attributes][phone]" type="tel">
<input name="customer[ship_address_attributes][ssnr]" type="tel">
<input name="customer[ship_address_attributes][organisation_number]" type="tel">
{% endwm3form %}
customer.profile
Customer profile is the template that contains all of the information about the user. The user can update their information on this page if they want.
Here you may want the user to be able to update their billing address or other information, more on this on Webshop addresses.
From customer profile you also have access to notifications and error messages.
Standard form for updating customer information
{% wm3form customer.update_url %}
// Any fields that you want the user to be able to update
{% endwm3form %}
Form for updating password
{% wm3form customer.update_url %}
<input name="customer[current_password]" type="password" required="required">
<input name="customer[password]" type="password" required="required">
<input name="customer[password_confirmation]" type="password" required="required">
{% endwm3form %}
customer.verification
Customer verification is the template where the user lands on when they have entered their details in the customer.register template, have received an email and clicked the button to verify their account.
In this template it is common to print out "Thank you for signing up to our webshop" and then use the standard form for customer.login
Updated: 2020-09-14