You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
I'm not sure if this is really a bug, but the getAllEnabledStatesAsListGroupedByCountryId seems to return states in a random order on every refresh.
To Reproduce
Output `{% dd craft.commerce.states.getAllEnabledStatesAsListGroupedByCountryId %} and refresh. On each refresh the order seems to change.
Thanks for reporting that! I’ve just fixed it for the next release.
You can work around the bug without waiting for the release by just sorting one country in the country list manually within the CP, and same for each group of states inside each country.
To get the fix early, change your craftcms/commerce requirement in composer.json to:
"require": {
"craftcms/commerce": "dev-develop#fb4cba2f85a36d4a25c3fdd760256d66d8f4bb0a as 3.1.8",
"...": "..."
}
Description
I'm not sure if this is really a bug, but the
getAllEnabledStatesAsListGroupedByCountryId
seems to return states in a random order on every refresh.To Reproduce
Output `{% dd craft.commerce.states.getAllEnabledStatesAsListGroupedByCountryId %} and refresh. On each refresh the order seems to change.
Video of the output
Expected behavior
I expected them to be ordered alphabetically.
Additional info
The text was updated successfully, but these errors were encountered: