Cleaning up state data loading on the checkout page

I noticed in the checkout page source code alot of extra information regarding states information being loaded and if your not selling to those countries no reason to have them enabled. For me I’m only selling to the USA market so removing this information from the array saved me about 14k worth of data loading on the page. By default all these states are “active” and if you look at the checkout page source code you’ll notice the long list starting out something like the following;


var states = new Array();
states['CH'] = new Array();
states['CH']['__AR'] = 'Appenzell Rhodes-Extérieures';
states['CH']['__AI'] = 'Appenzell Rhodes-Intérieures';
states['CH']['__AG'] = 'Argovie';
states['CH']['__BL'] = 'Bâle-Campagne';
states['CH']['__BS'] = 'Bâle-Ville';
states['CH']['__BE'] = 'Berne';
states['CH']['__FR'] = 'Fribourg';
...
...




From the Admin → Shipping → States you can disable these one by one or just execute an example SQL command shown below which disables all the countries except the US and Canada. You can update the sql code to manage what countries you need if you like working with SQL.



update cscart_states set status=‘D’ where cscart_states.country_code NOT IN (‘US’,‘CA’ );



Don’t assume, test this so it works for you.



v2.0.12 (testing)

If you are interested in having this fixed, you can add your comments to the following feature request (until they move this to the UserVoice system):

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=951[/url]



This is one of several easy usability enhancements that would make the cart more attractive, especially to new users:

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=953[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=944[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=946[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=996[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1445[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1069[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=945[/url]

[url]http://forum.cs-cart.com/vbugs.php?do=view&vbug_id=1473[/url]



Bob