Customer Nationality in sign up page

Solved

Customer Nationality in sign up page

juliusphilip
Visitor
1 0 0

How to add a nationality drop down menu in the sign up page as mandatory field for my customers to fill up.

Accepted Solution (1)

pawankumar
Shopify Partner
592 83 102

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!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan

View solution in original post

Replies 2 (2)

pawankumar
Shopify Partner
592 83 102

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!

- Need a Shopify developer? Chat on WhatsApp +91-9467121281
- Coffee Tip: Buymeacoffee  | Email: thepkpawankumar@gmail.com
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
Best regards,
Pawan

Brett_Helium
Shopify Partner
263 48 114

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.

Brett | Helium
Helium builds apps that thousands of merchants depend on:
- Customer Fields ✪✪✪✪✪ (350+ reviews)
- Meteor Mega Menu ✪✪✪✪✪ (280+ reviews)