How to add phone number field in user registeration field and show it on user's profile?

How to add phone number field in user registeration field and show it on user's profile?

vikj
Not applicable
3 0 0

 I have added a phone number field in user registration field but its not saving data anywhere. I need to show that data in user's profile in phone field.

Note: I have tried saving the phone number in note field but need to integrate into the profile phone field.

Here is my code:

<div class="field">
<label for="customerPhone">Phone Number</label>
<input
type="tel"
id="customerPhone"
name="customer[phone]"
spellcheck="false"
autocapitalize="off"
autocomplete="phone"
aria-required="true"
placeholder="Mobile Number"
{% if form.errors contains 'phone' %}
aria-invalid="true"
aria-describedby="RegisterForm-phone-error"
{% endif %}

{% if customer.phone %}
value="{{ customer.phone }}"
{% endif %}
required
>
<label for="RegisterForm-phone"> Mobile Number </label>
</div>
{%- if form.errors contains 'phone' -%}
<span id="RegisterForm-phone-error" class="form__message">
<svg aria-hidden="true" focusable="false">
<use href="#icon-error" />
</svg>
{{ form.errors.translated_fields.phone | capitalize }}
{{ form.errors.messages.phone }}.
</span>
{%- endif -%}

Reply 1 (1)

Taknify
Shopify Partner
203 14 26

Try Metafields instead. 

You can try to get that data to be stored on a metafield and then use that metafield on the customers/account.liquid page to show them that number. 

Need to tweak your store a bit? Come and visit us at Taknify or send me message.