In a standard installation, the states (regions) of countries are created in such a way that they are alphabetically ordered with incrementing IDs. However, if you were to modify the names of regions, or add new regions but do not add them in alphabetical order then they will be displayed incorrectly on the frontend.
The easiest way to reproduce is to add some additional regions to wp_wpsc_region_tax table in non-alphabetical sequence.
In my example, I added some regions to the United Kingdom:
| 65 | 223 | North west | NW | 0 |
| 66 | 223 | East | E | 0 |
| 67 | 223 | West | W | 0 |
| 68 | 223 | South | S | 0 |
| 69 | 223 | North East | NE | 0 |
As you can see, these were not added in alphabetical order.
If you visit the checkout process, with the United Kingdom as your country, but with Javascript disabled then the region list shows correctly.
However, if you visit checkout with Javascript enabled, then the Javascript that rebuilds the region list according to the selected country outputs the regions in ID order:
The relevant code appears to be wpsc_update_regions_list_to_match_country() in wp-e-commerce.js
In a standard installation, the states (regions) of countries are created in such a way that they are alphabetically ordered with incrementing IDs. However, if you were to modify the names of regions, or add new regions but do not add them in alphabetical order then they will be displayed incorrectly on the frontend.
The easiest way to reproduce is to add some additional regions to
wp_wpsc_region_tax
table in non-alphabetical sequence.In my example, I added some regions to the United Kingdom:
As you can see, these were not added in alphabetical order.
If you visit the checkout process, with the United Kingdom as your country, but with Javascript disabled then the region list shows correctly.
However, if you visit checkout with Javascript enabled, then the Javascript that rebuilds the region list according to the selected country outputs the regions in ID order:
The relevant code appears to be
wpsc_update_regions_list_to_match_country()
in wp-e-commerce.js