Country Sorting Not Alphabetical in WooCommerce
-
I’m experiencing an issue with country sorting in WooCommerce. When the site’s primary language is set to English, countries are sorted alphabetically. However, when switching to other languages (e.g.Estonian, Latvian), the sorting does not follow the correct alphabetical order but instead inherits the English order.
Setup details: No active plugins except WooCommerce
What I’ve tried:
- Using
woocommerce_countriesfilter to sort the countries manually. - Setting locale with
setlocale(LC_COLLATE, $locale). - Clearing WooCommerce cache and site transients.
None of these solutions have worked. It seems that WooCommerce forces the English sorting order even when a different language is selected.
Expected behavior: Countries should be sorted alphabetically based on the selected language.
Current behavior: Countries appear in the same order as in English, even when using a different language.
Is this a known issue, or is there another way to enforce proper alphabetical sorting in different languages?
I’ve checked several other multilingual websites, and they all have the same issue. It seems to affect everyone using a language other than English.
Thanks in advance for your help!
Mila - Using
The topic ‘Country Sorting Not Alphabetical in WooCommerce’ is closed to new replies.