All things Shopify and commerce
How to add a nationality drop down menu in the sign up page as mandatory field for my customers to fill up.
Solved! Go to the solution
This is an accepted solution.
Hi @juliusphilip
You can add it like this
<label for="customer_nationality">Nationality <span class="required">*</span></label>
<select id="customer_nationality" name="customer[note][nationality]" required>
<option value="" disabled selected>Select your nationality</option>
<option value="India">India</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="Andorra">Andorra</option>
<!-- Add more options here -->
<option value="Zimbabwe">Zimbabwe</option>
</select>
Please add it to the appropriate file like customers/register.liquid or sections/main-register.liquid
and update the nationality options as per you need
Please press Like and Mark Solution if you find it helpful.
Thanks!
This is an accepted solution.
Hi @juliusphilip
You can add it like this
<label for="customer_nationality">Nationality <span class="required">*</span></label>
<select id="customer_nationality" name="customer[note][nationality]" required>
<option value="" disabled selected>Select your nationality</option>
<option value="India">India</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="Andorra">Andorra</option>
<!-- Add more options here -->
<option value="Zimbabwe">Zimbabwe</option>
</select>
Please add it to the appropriate file like customers/register.liquid or sections/main-register.liquid
and update the nationality options as per you need
Please press Like and Mark Solution if you find it helpful.
Thanks!
Hey @juliusphilip!
The code provided by @pawankumar looks to be a good option if you want to code this yourself into the registration form, however the main limitation here is that this value would only end up getting saved into the customer note.
If you would like to save the nationality value into more a useful place such as a customer metafield or the customer's default address country field, you would need to use either a custom or public app to connect to Shopify's API. One option for this would be the Helium Customer Fields app, which allows you to create custom registration forms to collect whatever data you want when customers are signing up.
By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024