LemonStand Documentation

shop:login

The shop:login action is designed for creating the Login page. Also, the action allows to create combined pages with both the login and signup forms. Please refer to the Customer Login and Logout and Creating the Customer Registration page articles for the action usage examples.

Supported form fields

The following form fields are supported for the customer log in form.

  • email – customer email address. Required.
  • password – customer password. Required.
  • login – a name of a submit button element for the POST (non AJAX) form submit method.
  • redirect - an optional field containing an URL for redirecting a visitor's browser after the successful logging in. Note: if your copy of LemonStand is installed in a subdirectory, you need to use the root_url() function to generate correct URLs referring to LemonStand pages. To redirect to the originally requested page you can use the redirect_url() method of the controller. Example:
    <input type="hidden" value="<?= $this->redirect_url('/') ?>" name="redirect"/> 

The following form fields are supported for the customer sign up form.

  • first_name – customer first name
  • last_name – customer last name
  • email – customer email
  • password - customer password (optional)
  • password_confirm - customer password confirmation (required if the password field is presented on the form)
  • signup – a name of a submit button element for the POST (non AJAX) form submit method.
  • flash - a message to display on the target redirection page. Use the flash_message() function on the target page to display the message.
  • customer_auto_login - enables the automatic customer login feature. 

Supported AJAX handlers

  • shop:on_login – processes the customer login form. Use this handler for creating the Login link or button on the Login form. Example:
    <a href="#" onclick="return $(this).getForm().sendRequest('shop:on_login')">Login</a>
  • shop:on_signup – processes the customer signup form. Use this handler for creating the Signup link or button on the Signup form. Example: 
    <a href="#" onclick="return $(this).getForm().sendRequest('shop:on_signup')">Signup</a>

Next: shop:order
Previous: shop:compare
Return to Reference

Comments

No comments posted so far.

Add your comment

Loading form...