Adding fields to customer registration form

Highlighted
Tourist
4 0 1

Hi - Looking for some advice please, Im wanting to add a Business Name and Phone No. field to my customer registration form. 

On reading this article it looked pretty straight forward:
https://help.shopify.com/themes/customization/forms/get-more-information-with-customer-registration-...
But its just not working for me.

I simply copied one of the original fields code and changed it to Business Name where relevant, but that didnt work?   ie:
Original code:

<div id="last_name" class="clearfix large_form">
      <label for="last_name" class="login">{{ 'customer.register.last_name' | t }}</label>
      <input type="text" value="" name="customer[last_name]" id="last_name" class="large" size="30" />
</div>

copy, pasted and updated to:

<div id="business_name" class="clearfix large_form">
      <label for=" business_name " class="login">{{ 'customer.register. business_name | t }}</label>
      <input type="text" value="" name="customer[business_name]" id=" business_name " class="large" size="30" />
    </div>

I am using the Testament theme.
Im a total novice, although can usually figure things out so if anyone can offer any suggestions or advice, it would be greatly appreciated.
Thanks
J

Highlighted
Shopify Staff
Shopify Staff
523 1 102

Hey, Judith!

My name is Alex, I'm a guru here at Shopify!

Ah, gotcha!  The issue I'm seeing here is that it isn't possible to create a new area in the admin to hold the information you're collecting - that being the case, it'll need to be collected as a customer note. There's a little more info on this in our guide right over here!

I'd suggest starting with the example snippets of code, rather than copying the code that's already in your theme.  Once that's done, you can start customizing it as you like to get it looking like the other fields on your customer registration form - just make sure that you don't alter the instance of customer[note] that you see in the example, that has to remain there!  You can start with a code snippet something like this:

<label for="CustomerFormBusinessName">Business Name</label>
<input type="text" id="BusinessName" name="customer[note][Business Name]" placeholder="Business Name">

I've tried this one out in my own test store, and I can confirm this works!      

Hope that's helped!  Please feel free to let me know, and you can always give us a call or start a live chat at any time.  We're open 24/7 for your convenience and always happy to assist!

Cheers,

Alex | Shopify Guru

Highlighted
Tourist
4 0 1

Thank you, thank you :)
That worked a treat.

Much appreciated

J

0 Likes
Highlighted
Tourist
5 0 1

Hello,

you can also try App Registration Form Builder.

With this app you can build your own registration form with unlimited form fields, like you wish.

All options you can set from App configuration, without coding skills.

App is free for first 7 days.

 

 

1.jpg

0 Likes
Highlighted

FYI, you can save a customer's Business name/Company name to your Shopify admin, as long as it's part of a shipping address. We make this possible with the Customer Fields app, not sure if it's possible through @Alex23's suggested method. The "Company" field shown in the GIF below saves to the "default_address.company" data column in Shopify admin.

 

Screen Recording 2019-12-23 at 03.03 PM.gif

 

You can use Customer Fields to add custom fields to your registration form-- no code needed to build your form or install it on your theme.

Michael | Business Development @ Helium
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Helium builds apps that merchants depend on:
Customer Fields app (since 2015)
Meteor Mega Menu app (since 2014)
Highlighted
New Member
2 0 1
Is there any way to have the information populate a field that already exists like phone number or address instead of the [Note]??

 

0 Likes
Highlighted
Explorer
68 0 12

I have the same question as @Rishtyssr ;  @Alex23 any updates? thank you!

Highlighted

@Rishtyssr @danielagsb 

You can only save phone number or address data, respectively, to those fields because of the validation of that data. You cannot save other custom data to these placeholders within the Shopify admin. If you want to save custom data, you need to use Shopify's metafields.

What type of data are you trying to save to Shopify admin and for what purpose?

Michael | Business Development @ Helium
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Helium builds apps that merchants depend on:
Customer Fields app (since 2015)
Meteor Mega Menu app (since 2014)
0 Likes
Highlighted
Explorer
68 0 12

Hi @michael-helium thank you for your response. 

 

I tried including fields that correspond to the address fields for City & Country in the customer's register form (customers/register.liquid), following the nomenclature in the 'addresses' file: 

        <label for="AddressCityNew" class="label--hidden">{{ 'customer.addresses.city' | t }}</label>
        <input type="text" id="AddressCityNew" class="input-full" name="address[city]" placeholder="City" value="{{ form.city }}" autocapitalize="words">

        <label for="AddressCountryNew" class="label--hidden">>{{ 'customer.addresses.country' | t }}</label>
        <select id="AddressCountryNew" class="input-full" name="address[country]" data-default="{{ form.country }}">{{ all_country_option_tags }}</select>

When I try the above, the customer can register but the info on city / country is not saved - I am not sure if I am making a mistake but would appreciate your guidance. 

 

When a user arrives to my website, he needs to register in order to be able to access any content, so my objective is to collect the city and country in that moment, and for that information to be saved in his account, in the same way that his FirstName and LastName are saved - I do not want to create new fields, but populate those that already exist.  

 

At the moment I only managed to save this information as notes - 

        <label for="AddressCityNew" class="label--hidden">{{ 'customer.addresses.city' | t }}</label>
        <input type="text" id="AddressCityNew" class="input-full" name="customer[note][city]" placeholder="City" value="{{ form.city }}" autocapitalize="words" required>

        <label for="AddressCountryNew" class="label--hidden">>{{ 'customer.addresses.country' | t }}</label>
        <select id="AddressCountryNew" class="input-full" name="customer[note][country]" data-default="{{ form.country }}">{{ all_country_option_tags }}</select>
       

Many thanks!

 

0 Likes
Highlighted

@danielagsb 

I'm not a developer, so unfortunately I can't comment on your code or why it's not working. What I do know is that Shopify does some dynamic validation of addresses which may be the reason you're having a difficult time saving that data. For example, Shopify provides dynamic values for the State/Province field based on the input for the Country field. It's also possible the Country data isn't saving because it doesn't exactly meet Shopify's validation requirements.

 

I understand wanting to avoid 3rd party apps in general as well as wanting to keep monthly costs down, but we built the Customer Fields app to solve these exact problems and we offer amazing support for developers. Based on this and other forum posts I've seen from you, I believe you (or your client) would get at least 10x the value over the app's subscription cost. 😄 


Plus.... if you're working in a dev shop (affiliate or plus partner sandbox plan), the app is free to install and use.

Michael | Business Development @ Helium
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Helium builds apps that merchants depend on:
Customer Fields app (since 2015)
Meteor Mega Menu app (since 2014)
0 Likes