How Do I Limit the States and Provinces in My Site's Dropdown?

  • 0
  • 1
  • Question
  • Updated 5 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

Please note that while we offer this tutorial and it is tested and working at the time of creation, any customization of or support for these types of articles is outside of our scope of support. If you require assistance with any design or customization, we recommend that you either visit our community forums or contact one of our fantastic design consultants.

Customizing Your State/Province 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">
$(document).ajaxSuccess( function() {
$("#FormField_12 option:contains('Puerto Rico')").remove();
$("#FormField_12 option:contains('Alaska')").remove();
$("#FormField_12 option:contains('Hawaii')").remove();
$("#FormField_22 option:contains('Puerto Rico')").remove();
$("#FormField_22 option:contains('Alaska')").remove();
$("#FormField_22 option:contains('Hawaii')").remove();
});
</script>

*In this example we are removing Puerto Rico, Alaska, and Hawaii, however, the same format can be used with any state or province. Please note that the values must remain on their own line.

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

checkoutcode2013-06-20_1626.png

8.) Save.

 

Customizing the State/Province 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">
$(document).ready( function() {
$("#shippingZoneState option:contains('Puerto Rico')").remove();
$("#shippingZoneState option:contains('Alaska')").remove();
$("#shippingZoneState option:contains('Hawaii')").remove();
});
$(document).ajaxSuccess( function() {
$("#shippingZoneState option:contains('Puerto Rico')").remove();
$("#shippingZoneState option:contains('Alaska')").remove();
$("#shippingZoneState option:contains('Hawaii')").remove();
});
</script>


 

*In this example we are removing Puerto Rico, Alaska, and Hawaii, however, the same format can be used with any state or province. Please note that the values must remain on their own line.

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

cartcontentcode2013-06-20_1641.png

8.) Save.

 

Customizing the State/Province 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">
$(document).ready( function() {
$("#FormField_12 option:contains('Puerto Rico')").remove();
$("#FormField_12 option:contains('Alaska')").remove();
$("#FormField_12 option:contains('Hawaii')").remove();
});
</script>
<script type="text/javascript">
$(document).ajaxSuccess( function() {
$("#FormField_12 option:contains('Puerto Rico')").remove();
$("#FormField_12 option:contains('Alaska')").remove();
$("#FormField_12 option:contains('Hawaii')").remove();
});
</script>

*In this example we are removing Puerto Rico, Alaska, and Hawaii, however, the same format can be used with any state or province. Please note that the values must remain on their own line.

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

createaccountcode2013-06-20_1701.png

8.) Save.

Photo of Drew N

Drew N, Community Manager

  • 257,542 Points 100k badge 2x thumb

Posted 5 years ago

  • 0
  • 1

There are no replies.

This conversation is no longer open for comments or replies.