password.liquid

The password.liquid template is used to render your online store's password page. This page appears only if you password protect your storefront. If you want to see what this looks like, visit our demo password-protected store.

Ex password

Template Considerations

Displaying your password message

You can add a custom message to your online store's password page. To output the password message, include the following:


{% unless shop.password_message == blank %}
  {{ shop.password_message }}
{% endunless %}

Outputting the password form

To output a form that visitors use to enter your password-protected storefront, initialize the form tag with the parameter 'storefront_password'. Within the form, include the following:

  • an input element with the type attribute set to password and the name attribute set to password
  • an input element with the type attribute set to submit, to submit the form.

Below is an example of a simple password form:


{% form 'storefront_password' %}

{{ form.errors | default_errors }}

<label for="password">Enter store using password:</label>
<input type="password" name="password">
<input type="submit" value="Enter">

{% endform %}

Collecting customer email addresses

Similar to how you can add a Shopify newsletter sign-up form to your Shopify store, you can add an email sign-up form to your online store's password page. This can be useful for building a customer base while getting your Shopify store ready for launch or for capturing store access requests for your wholesale business.

To output a customer sign-up form, initialize the form tag with the parameter 'customer'. Within the form, include the following:

  • an input element with the type attribute set to hidden, the name attribute set to contact[tags], and the value attribute set to prospect, password page (Shopify will assist you in marketing to customers created with these tags)
  • an input element with the type attribute set to email and the name attribute set to contact[email]
  • an input element with the type attribute set to submit, to submit the form.

Below is an example of a simple customer sign-up form:


{% form 'customer' %}

  {{ form.errors | default_errors }}

  {% if form.posted_successfully? %}
    <p>Thanks for signing up!</p>
  {% else %}
    <p>Find out when we open:</p>
    <input type="hidden" name="contact[tags]" value="prospect, password page">
    <label for="email">Email address</label>
    <input type="email" name="contact[email]" id="email" placeholder="Your email">
    <input type="submit" value="Submit">
  {% endif %}

{% endform %}

Want to discuss this page?

Visit the Shopify Community