We're constantly trying to improve your support experience, and your feedback is extremely valuable to us.

Please take a moment to tell us about your experience today.
Sign up for future Help Center user research studies.

The all_country_option_tags object

The all_country_option_tags object creates an <option> tag for each country.

An attribute called data-provinces is set for each <option>, and contains a JSON-encoded array of the country's subregions. If a country doesn't have any subregions, then an empty array is set for its data-provinces attribute.


<select name="country">
  {{ all_country_option_tags }}


<select name="country">
  <option value="---" data-provinces="[]">---</option>
  <option value="Afghanistan" data-provinces="[]">Afghanistan</option>
  <option value="Aland Islands" data-provinces="[]">Åland Islands</option>
  <option value="Canada" data-provinces="[["Alberta","Alberta"],["British Columbia","British Columbia"],["Manitoba","Manitoba"],["New Brunswick","New Brunswick"],["Newfoundland","Newfoundland"],["Northwest Territories","Northwest Territories"],["Nova Scotia","Nova Scotia"],["Nunavut","Nunavut"],["Ontario","Ontario"],["Prince Edward Island","Prince Edward Island"],["Quebec","Quebec"],["Saskatchewan","Saskatchewan"],["Yukon","Yukon"]]">Canada</option>

Ready to start selling with Shopify?

Try it free