Get more information with the customer registration form

You might want to gather more information from a customer when they create an account in your store. Maybe you'd like to send them a gift on their birthday. This tutorial will outline how to add extra fields to the customer registration form.

Caution

Since it isn't possible to create a new area in the admin to hold the information you're collecting, you will need to relay it as a customer note. All additional collected information will be displayed on the customer account page:

Add to registration form customer note
It's not possible to populate existing fields other than Name and Email. You won't be able to capture a customer's address or phone number inside the registration form. A customer will provide an address with their first order.

Locating the account creation form

  1. From your Shopify admin, click Online Store, and then click Themes (or press G W T).

  2. Find the theme you want to edit, click the ... button, and then click Edit HTML/CSS.

  3. Click the Templates folder to expand and view its contents.

  4. Under the Templates folder, click on customers/register.liquid.

    Add to registration form locate template
  5. In customers/register.liquid, locate the following code:

    
    {% form 'create_customer' %}
    
    

    Add the form fields between that code, and this one:

    
    {% endform %}
    
    

Caution

Just be sure not to place your form fields outside of that block of code.

Adding a form field

It's good practice to keep all new fields above the password field.

Add to registration form where

To add a text field, use this:

<label>The text shown as label in the form</label>
<input type="text" name="customer[note][Label]" placeholder="Placeholder text" />

Tip

The attribute name="customer[note][Label]" is essential here. With it, the information will be submitted as a customer note. Without it, nothing will be submitted.

The [label] part will act as a label for the information when it is shown in the Note section on the customer account page in your store's admin. Replace the label text with your own unique label. That can contain white space and capital letters.

For example, use name="customer[note][Birthday]" to capture a birthday:

<label for="birthday">Your birthday</label>
<input id="birthday" type="text" name="customer[note][Birthday]" placeholder="Your birthday" />

Types of inputs

Here are some examples of other types of form fields that can be added:

  • Checkbox

    <label for="tacos" class="login">Would you like us to send you some tacos?</label>
    <input type="checkbox" value="Yes Please!" name="customer[note][Tacos?]" id="tacos" />
    
  • Radio button

    <label>What type of tacos do you prefer?</label>
    <span>Fish</span><input type="radio" value="Fish" name="customer[note][Taco Type]" /><br/>
    <span>Beef</span><input type="radio" value="Beef" name="customer[note][Taco Type]" /><br/>
    <span>Chicken</span><input type="radio" value="Chicken" name="customer[note][Taco Type]" />
    
  • Drop-down select

    <label for="taco-count">How many tacos would you like?</label>
    <select name="customer[note][Taco Count]" id="taco-count">
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
    </select>
    

Want to discuss this page?

Visit the Shopify Community