Venture theme Customer Registration Fields

iCWK
Excursionist
27 0 2

Hi, I would like to add phone number field as mandatory.

I am not a coder so I search some similar post and copy and paste. 

I tried adding 

<label for="Phone" class="hidden-label">{{ 'customer.register.phone' | t }}</label>        <input type="phone" "customer[note][phone]" id="Phone" class="input-full{% if form.errors contains 'phone' %} error{% endif %}" placeholder="{{ 'customer.register.phone' | t }}" {% if form.phone %} value="{{ form.phone }}"{% endif %} autocorrect="off" autocapitalize="off">

after the email but failed.

customers/register.liquid

<div class="page-width">
<div class="grid">

<div class="grid__item medium-up--one-half medium-up--push-one-quarter">
<div class="content-block text-center">
<h1>{{ 'customer.register.title' | t }}</h1>

<div class="form-vertical text-center">
{% form 'create_customer' %}

{{ form.errors | default_errors }}

<label for="FirstName" class="label--hidden">{{ 'customer.register.first_name' | t }}</label>
<input type="text" name="customer[first_name]" id="FirstName" placeholder="{{ 'customer.register.first_name' | t }}" {% if form.first_name %}value="{{ form.first_name }}"{% endif %} autofocus>

<label for="LastName" class="label--hidden">{{ 'customer.register.last_name' | t }}</label>
<input type="text" name="customer[last_name]" id="LastName" placeholder="{{ 'customer.register.last_name' | t }}" {% if form.last_name %}value="{{ form.last_name }}"{% endif %}>

<label for="Email" class="label--hidden">{{ 'customer.register.email' | t }}</label>
<input type="email" name="customer[email]" id="Email" class="{% if form.errors contains 'email' %} input--error{% endif %}" placeholder="{{ 'customer.register.email' | t }}" {% if form.email %} value="{{ form.email }}"{% endif %} autocorrect="off" autocapitalize="off">

<label for="CreatePassword" class="label--hidden">{{ 'customer.register.password' | t }}</label>
<input type="password" name="customer[password]" id="CreatePassword" class="{% if form.errors contains 'password' %} input--error{% endif %}" placeholder="{{ 'customer.register.password' | t }}">

<p>
<input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn">
</p>

{% endform %}
</div>
</div>
</div>
</div>
</div>

Appreciate. Thank you
 
0 Likes
satsinghrana
Shopify Partner
118 11 16

Take a backup of your old file the give a try to below code:

Ad this code:

<div class="page-width">
    <div class="grid">
        <div class="grid__item medium-up--one-half medium-up--push-one-quarter">
            <div class="content-block text-center">
                <h1>{{ 'customer.register.title' | t }}</h1>

                <div class="form-vertical text-center">
                    {% form 'create_customer' %} {{ form.errors | default_errors }}

                    <label for="FirstName" class="label--hidden">{{ 'customer.register.first_name' | t }}</label>
                    <input type="text" name="customer[first_name]" id="FirstName" placeholder="{{ 'customer.register.first_name' | t }}" {% if form.first_name %}value="{{ form.first_name }}" {% endif %} autofocus />

                    <label for="LastName" class="label--hidden">{{ 'customer.register.last_name' | t }}</label>
                    <input type="text" name="customer[last_name]" id="LastName" placeholder="{{ 'customer.register.last_name' | t }}" {% if form.last_name %}value="{{ form.last_name }}" {% endif %} />

                    <label for="Email" class="label--hidden">{{ 'customer.register.email' | t }}</label>
                    <input type="email" name="customer[email]" id="Email" class="{% if form.errors contains 'email' %} input--error{% endif %}" placeholder="{{ 'customer.register.email' | t }}" {% if form.email %} value="{{ form.email }}" {% endif %} autocorrect="off" autocapitalize="off" />
                        
                    <label for="Phone" class="hidden-label">{{ 'customer.register.phone' | t }}</label>        
                    <input required type="phone" name="customer[note][phone]" id="Phone" class="input-full{% if form.errors contains 'phone' %} error{% endif %}" placeholder="{{ 'customer.register.phone' | t }}" {% if form.phone %} value="{{ form.phone }}"{% endif %} autocorrect="off" autocapitalize="off">



                    <label for="CreatePassword" class="label--hidden">{{ 'customer.register.password' | t }}</label>
                    <input type="password" name="customer[password]" id="CreatePassword" class="{% if form.errors contains 'password' %} input--error{% endif %}" placeholder="{{ 'customer.register.password' | t }}" />

                    <p>
                        <input type="submit" value="{{ 'customer.register.submit' | t }}" class="btn" />
                    </p>

                    {% endform %}
                </div>
            </div>
        </div>
    </div>
</div>

 

Let me know!

If helpful then please Like and Accept Solution
Hire for Custom Shopify Solutions, Apps development or Any kind of Web development work.
Contact : satsinghrana1@gmail.com
See our Shopify Apps: HERE
0 Likes