Shopify themes, liquid, logos, and UX
Hi,
I want to add phone in account register page, so I have added new field with below code but it's not working, can you please guide me on the same?
<div class="field">
<input
type="text"
name="customer[phone]"
id="RegisterForm-phone"
{% if form.phone %}value="{{ form.phone }}"{% endif %}
placeholder="{{ 'customer.register.phone' | t }}"
>
<label for="RegisterForm-phone">
{{ 'customer.register.phone' | t }}
</label>
</div>
can you please share full code
Hi,
Here you can see full code, I want to add phone field at the time of user registration and want to store in phone field in customer section, you can see in below screenshots what I have tried and what I want to achieve.
frontend: https://prnt.sc/26skq36
backend code: https://prnt.sc/26skqbg
what I want to achieve: https://prnt.sc/26skrdk
I hope I make this question clear with all above description. Thank you in advance!
<div id="phone_number" class="clearfix large_form">
<label for="phone_number" class="login">Phone Number</label>
<input type="phone_number" class="form-control" name="customer[phone_number]" id="phone_number" class="large" size="30" />
</div
This solution does not work. could you please suggest?
probably too late to answer but this worked for me:
{{ customer.default_address.phone }}
Here's the sample code for the input field:
<input class="#form-input" autocomplete="tel" type="tel" id="ContactForm-phone" name="contact[phone]" value="{% if form.phone %}{{ form.phone | escape }}{% elsif customer %}{{ customer.default_address.phone | escape }}{% endif %}" placeholder="{{ 'templates.contact.form.phone' | t }}">
NOTE: This only extracts the phone number from the default_address.
So, you need to extract the default_address name, email and other details too.
{{ customer.default_address.name }} <!-- get Name from Default Address -->
{{ customer.default_address.email }} <!-- get Email from Default Address -->
Sample Output:
Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025Discover opportunities to improve SEO with new guidance available from Shopify’s growth...
By Jacqui May 1, 2025