Phone Number as compulsory in Customer Registration

ShafiqNewbie
Tourist
5 0 2

Hello. I'm new here and i need help as i don't really know liquid codes. Currently, i'm using Empire's theme for our store. We want to add a phone number fields in customer create account and it is compulsory. I asked Empire's theme support and they can't help me with that. We just started this store and really don't have budget to hire shopify expert. Can anyone help me solved this?

Replies 15 (15)

Developer-G
Shopify Partner
3033 593 846

Hi,
1. Go to Online Store->Theme->Edit code
2. Templates->customers/register.liquid->paste bellow code after password field or where you want it

<label for="register_phone_number" class="form-field-title" >Phone Number</label><br />
          <input
            type="text"
            class="form-field-input form-field-text"
            id="register_phone_number"
            name="customer[note][phonenumber]"
            value=""
          />

And if you need validation in it you can try html attribute required or custom JS

Thanks

- If helpful then please Like and Accept Solution.
- Want to modify or custom changes or bug fix on store Hire me.
- Email: guleriathakur43@gmail.com - Skype: navrocks1 ,
- Try GEMPAGES a great page builder
-Advance Search Filter
ShafiqNewbie
Tourist
5 0 2

Thanks for your reply, I already try it and it save the phone number in customer notes.

Annotation 2020-02-14 083319.png

It should appeared in here.

Annotation 2020-02-14 083319=.png

It also didn't appeared in my account page.

Annotation 2020-02-14 0833191.png

 

This is the code from Flits Account Page Snippet..

<div class="flits-row flits-m-t-15">
  <div class="flits-col-md-6">
     <label>{{ 'flits.profile_page.contact_no' | t }}:</label>
     <label class="flits-hide-profile-edit">{{ customer.phone }}</label>
     <input type="text" name="phone" class="flits-hidden flits-hide-profile-cancel"  value="{{ customer.phone }}">
  </div>
</div>

Please help me .

ShafiqNewbie
Tourist
5 0 2

Anyone seeing this? Please help me solve this problem.

Physiocoder
Tourist
4 0 2

Hi, have the same problem here.

Seems quite awkward to store a phone number as a note since there is a customer field for this information. Beside this, if you store the phone number as a note Shopify will not send sms notifications to the customer.

Has anyone a solution to this? Should be quite straightforward to do, but all I tried didn't functioned.

 

Thanks

 

Amitjaiswal
Shopify Partner
29 0 7

Hello guys i was also  struck into the same problem Customer additional field are saving in admin as a note not as a attribute then i saw a app called Customer Field i am always against using app but i still watch its video he explain that shopify doesn't allow us to collect additional data other than a name and email  You can check the video here .

https://youtu.be/Dc7hYBFGjmg

 

Note:I am not promoting app but a solution he explain in a video

Thanks
michael-helium
Shopify Expert
361 5 178

Hi @ShafiqNewbie @Physiocoder

I'm Michael from Helium, maker of the Customer Fields app. Customer Fields is an ideal solution for adding a customer registration form phone number field.

On the app's Basic tier, you can add any of the default Shopify fields (including phone number, accepts_marketing, address fields, etc.) and the data will sync with the Customer page in your Shopify admin. Furthermore, you can mark the field as required (compulsory) or optional depending on your own needs.

It works with all themes, and you can even choose to install your registration form(s) on different pages other than "account/register/" if needed.

If you need to add custom fields such as date of birth, image uploads, etc. there are more fields available on the Pro plan. For more information about why an app is required for saving custom data to a customer record in Shopify, see this thread.

Michael, COO @ Helium
- Customer Fields ✪✪✪✪✪ (346 reviews)
- Meteor Mega Menu ✪✪✪✪✪ (265 reviews)
RobMW
Tourist
10 0 3

Dear Michael, does Costumer Field allow for phone number verification? Can we connect a local service for sending SMS with a verification code?

michael-helium
Shopify Expert
361 5 178

Hi @RobMW, sorry I missed this. We don't offer phone number verification in the app, just email verification.

Michael, COO @ Helium
- Customer Fields ✪✪✪✪✪ (346 reviews)
- Meteor Mega Menu ✪✪✪✪✪ (265 reviews)
XxDrAg0nxX
Tourist
8 0 1

No one managed to make customer phone number compulsary during account creation yet?

 

 

michael-helium
Shopify Expert
361 5 178

@XxDrAg0nxX if that's all you need to accomplish, then the Customer Fields app's Basic plan is all you need. You can add the phone number field to your store's registration form and mark it as required. The data is synced to Shopify's phone number data key and visible on the Customer page in your Shopify admin (not in the Customer Note).

Michael, COO @ Helium
- Customer Fields ✪✪✪✪✪ (346 reviews)
- Meteor Mega Menu ✪✪✪✪✪ (265 reviews)
Minakshi1
Visitor
2 0 0

I'm using this code this code to display contact no on edit customer page but its not working:-

<label for="register_phone_number" class="form-field-title" > {{ 'customer.register.phone' | t }}</label><br />
<input
type="text"
class="Polaris-Label__Text_yj3uv"
id="register_phone_number"
name="customer[note][phone]"
value=""
/>

gchaney
Excursionist
43 2 4

Login to your shopify accounts. Bottom left is the shopify settings icon (the gear) click on that. Select checkout link to modify your checkout settings. 

 

This is where you set you account requirement settings. Scroll down to form options. Select shipping address phone number as required. It will require a phone number to checkout whether or not you require an account to checkout/buy from you. 

 

Cheers

Zakfdl22
Visitor
1 0 0

Hi, 

I think it's a little late, but I have something that might help.

 

Go to: Store->Themes 

On your theme select Actions->Edit Code

Under Templates open customers/register.liquid. 

and paste this code anywhere under </div>

 

 

 

 <div class="form-group">
                  <label for="loginPhone">{{ 'customer.register.Phone' | t }} {% if required != "" %}<sup>*</sup>{% endif %}</label>
                  <input type="number" name="customer[phone]" class="form-control" id="loginPhone" placeholder="{{ 'customer.register.Phone_form' | t }}">
                </div>

 

 

 

Zakfdl22_0-1619330733298.png

 

Save and go to Locals then open en.default.json (or your website default language file) 

look for register (Ctrl+F then type register) and add the new parameters with their translations. 

Zakfdl22_0-1619330630430.png

To show the mobile number on the account page: 

Under Templates open customers/account.liquid.  and add this code: 

 

<tr>
                <td>{{ 'customer.account.phone' | t }}</td>
                <td>{{ customer.phone }}</td>
              </tr>
              

 

Zakfdl22_0-1619330954793.png

 

amosmos
Shopify Expert
81 1 32

Hey @Zakfdl22 ,

Your solution looks very promising, but it doesn't seem to work...

When adding such field to the registration form, the value isn't saved anywhere in the customer record.

Shopify seems to ignore any field that is not a note.

Can you clarify your solution?

Thanks,

Amos

RococoDigital
Shopify Partner
12 1 11

I've not tested this but Shopify not saving the number could be related to validation.

The shopify API requires phone numbers to be formatted E.164 I believe and if you submit anything else it rejects it.