This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

Automatic customer registration

You can configure the checkout process to register new customers automatically. The shop:checkout action accepts a number of hidden fields which allow you to solve the following tasks:

  • Customer registration with a password specified by the customer
  • Customer registration with a random password
  • Customer registration with an optional password
  • Automatic customer login on checkout
  • Sending a registration confirmation email notification with a password

Implementing the automatic customer registration

If you use the AJAX-based single-page checkout, you can can add all fields which manage the customer registration behavior to the checkout page. If you used a default store template, included to the installer, you need to modify the checkout_partial partial. This partial contains a form which wraps all checkout steps. Please add the following hidden field before the closing <form> tag:

<input name="register_customer" value="1" type="hidden"/>

This hidden field enables the customer registration feature. If you want to allow customers specifying their passwords for the registration, you need to add two password-type fields to the billing information partial (shop:checkout_billing_info in the default store template). Note that the customer registration fields should be hidden in case if a customer already logged in:

<? if (!$this->customer): ?>
  <label for="customer_password">Password</label>
  <input autocomplete="off" id="customer_password" name="customer_password"  type="password"/>

  <label for="customer_password_confirm">Password confirmation</label>
  <input autocomplete="off" id="customer_password_confirm" name="customer_password_confirm"  type="password"/>
<? endif ?>
{% if not this.customer %}
  <label for="customer_password">Password</label>
  <input autocomplete="off" id="customer_password" name="customer_password"  type="password"/>

  <label for="customer_password_confirm">Password confirmation</label>
  <input autocomplete="off" id="customer_password_confirm" name="customer_password_confirm"  type="password"/>
{% endif %}

Allowing customers to omit the password

LemonStand can generate customer passwords automatically. To enable this mode, please add the allow_empty_password hidden field to the checkout page (checkout_partial partial in the default store template):

<input name="allow_empty_password" value="1" type="hidden"/>

You can also remove the password fields from the billing information partial. In this case customers will not have an option to specify a password, and the password will be generated automatically by LemonStand.

Automatic customer logging in

LemonStand can automatically log customers in on checkout. To enable this option please add the customer_auto_login hidden field to the checkout page:

<input name="customer_auto_login" value="1" type="hidden"/>

Sending a registration email notification

To enable the registration notification, please add the customer_registration_notification hidden field to the checkout page:

<input name="customer_registration_notification" value="1" type="hidden"/>

LemonStand uses the email template with the shop:registration_confirmation code. You can customize this message on the System/Settings/Email Templates page.

Customizing the error messages

There are 3 error types which could occur during the automatic customer registration. You can customize the message text with the following hidden fields:

  • no_password_error - error message to display in case if the customer did not specify his password. Default value is "Please enter your password.".
  • passwords_match_error - error message to display in case if the password and its confirmation do not match. Default value is "Password and confirmation password do not match.".
  • customer_exists_error - an error to display in case if a customer with the specified email address already exists. Default value is "A customer with the specified email is already registered. Please log in or use another email.".

Implementing customer registration with step-by-step checkout

If you implemented the step-by-step checkout process, the most of the hidden fields should be placed to the Billing Information step page (a page managed by the shop:checkout_billing_info action):

  • register_customer
  • allow_empty_password
  • customer_password
  • customer_password_confirm
  • no_password_error
  • passwords_match_error
  • customer_exists_error

The customer_auto_login and customer_registration_notification hidden fields should be placed to the Order Review step page (the one managed by the shop:checkout_order_review action).


Previous: Creating a Customer Account Change Password Page
Return to Customer Accounts and Registration