I'm setting up a Craft Commerce site and for some of the countries the user must specify a State. However, the order of states appears to be alphabetical.

The problem is that the site's traffic comes mainly from 2-3 states so it would be much easier for the vast majority of users to find those states if they appear at the top.

Craft Commerce seems to allow custom ordering for countries. Is there a way to do the same for States?


Not at the moment, you would need to manually put the states at the top of your select box in the front-end. There is no harm if you have a duplicate select option in your form, so you could list the popular ones first, then list all of them.

We will look to add sorting of States in a future release of Craft Commerce. I have added it as a feature request and can follow progress there: https://github.com/craftcms/commerce/issues/1284


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.