How Do I Limit the Countries in My Site's Dropdown?

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Answered
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Archived

Customizing Your Country List at Checkout
1.) Log in to your Bigcommerce Control Panel.
2.) Go to Design.

 

design2013-05-15_1805.png

3.) Choose the Template Files tab.

template_files2013-05-15_1805.png

4.) Scroll down to the Snippets folder and expand it by clicking the plus sign.

snippets2013-05-15_1806.png

5.) Once expanded, find ExpressCheckoutChooseAddress.html and select edit.

expresscheckoutchooseaddress2013-05-15_1828.png

6.) Copy the following code to your clipboard:

<script type="text/javascript">
$(function(){
$('#FormField_11').html('<option value="">Choose a Country</option><option value="United States">United States</option><option value="Canada">Canada</option>');
$('#FormField_21').html('<option value="">Choose a Country</option><option value="United States">United States</option><option value="Canada">Canada</option>');
});
</script>

*In this example, we are setting the countries to United States and Canada. For a full list of checkout country values, please see the "Checkout Country List" text file at the bottom of this article. Please note that the values must remain back-to-back. Do not list each value on its own line.

7.) Paste the contents of your clipboard to the bottom of the file.

checkoutcode2012-07-10_1839.png

8.) Save.

 

Customizing the Country List On Your Cart
1.) Log in to your Bigcommerce Control Panel.
2.) Go to Design.

design2013-05-15_1805.png

3.) Choose the Template Files tab.

template_files2013-05-15_1805.png

4.) Scroll down to the Panels folder and expand it by clicking the plus sign.

panels2013-05-15_1829.png

5.) Once expanded, find CartContent.html and select edit.

cartcontent2013-05-15_1832.png

6.) Copy the following code to your clipboard:

<script type="text/javascript">
$(window).load(function(){
$('#shippingZoneCountry').html('<option value="">Choose a Country</option><option value="226">United States</option><option value="038">Canada</option>');
});
</script>


 

*In this example, we are setting the countries to United States and Canada. For a full list of cart country values, please see the "Cart Country List" text file at the bottom of this article. Please note that the values must remain back-to-back. Do not list each value on its own line.

7.) Paste the contents of your clipboard to the bottom of the file.

cartcode2012-07-10_1844.png

8.) Save.

 

Customizing the Country List in Your Account Creation Page
1.) Log in to your Bigcommerce Control Panel.
2.) Go to Design.

 

design2013-05-15_1805.png

3.) Choose the Template Files tab.

template_files2013-05-15_1805.png

4.) Scroll down to the Panels folder and expand it by clicking the plus sign.

panels2013-05-15_1829.png

5.) Once expanded, find CreateAccountForm.html and select edit.

createaccountform2013-05-15_1832.png

6.) Copy the following code to your clipboard:

<script type="text/javascript">
$(function(){
$('#FormField_11').html('<option value="">Choose a Country</option><option value="United States">United States</option><option value="Canada">Canada</option>');
});
</script>

*In this example, we are setting the countries to United States and Canada. For a full list of checkout country values, please see the "Checkout Country List" text file at the bottom of this article. Please note that the values must remain back-to-back. Do not list each value on its own line.

7.) Paste the contents of your clipboard to the bottom of the file.

createaccountcode2013-05-15_1849.png

8.) Save.

 

Selecting Your Default Country
In either of the instances above you can set the default country that is selected when your customer arrives on the page.
Choose which country you want to be default and add selected="selected" (quotes included) between the words option and value in the code used above.

Using the above checkout example and setting United States as default, the result will look like this:
<script type="text/javascript">
$(function(){
$('#FormField_11').html('<option value="">Choose a Country</option><option selected="selected" value="United States">United States</option><option value="Canada">Canada</option>');
$('#FormField_21').html('<option value="">Choose a Country</option><option selected="selected" value="United States">United States</option><option value="Canada">Canada</option>');
});
</script>

Photo of Drew N

Drew N, Community Manager

  • 257,542 Points 100k badge 2x thumb

Posted 5 years ago

  • 0
  • 1
Photo of S

S

  • 6,570 Points 5k badge 2x thumb
Hello Drew -

Could you please tell me if this info (images not available) is still valid for changing Countries in BC? We talked about this some time ago (I was hoping for a follow up then) but that 'conversation' has been closed and the link provided in it is now 'not found'.

https://community.homestead.com/homestead/topics/remove-countries-from-shipping-list-dropdown?utm_so...

"Could you tell me where/how to remove Countries from the Drop Down for Shipping Estimates and/or Checkout? I think it has changed from some time ago and I have not be able to locate anything on BC doc's.

Thanks!"
Photo of Drew N

Drew N, Community Manager

  • 257,542 Points 100k badge 2x thumb
It is not. Sorry. I will have to update it, but in the mean time you can see the updated topic at BC. https://support.bigcommerce.com/articles/Public/Limiting-Countries-Listed-on-Your-Stores-Forms/?q=co...
Photo of S

S

  • 6,570 Points 5k badge 2x thumb
Thanks for the updated link at BC - in quick review looks like what I need - will follow up if any additional questions.

Thanks again.

This conversation is no longer open for comments or replies.