Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 5.11.0
-
Fix Version/s: 5.13.0-b1
-
Component/s: Staff Interface
-
Labels:None
Description
Some of our ISO codes are wrong. For example, for Czech Republic, the name Ústí nad Labem has the code 427 (states table), but according to https://en.m.wikipedia.org/wiki/ISO_3166-2:CZ it should be CZ-42.
We need to update all states (check countries also) so that they have the correct code. Helpful resources can be found here https://docs.blesta.com/pages/viewpage.action?pageId=10551368#Debugging/Tools-StatesandCountries
Separately, some regions prefer the name to be shown and not the code. In the US, Canada, Australia it's fine to show the code. For example, California's code of CA is expected in the postal address.
However, for Czech Republic, the correct code CZ-42 should not be displayed, but the name Ústí nad Labem should be displayed. There's no obvious list that shows the preference here, we will need to try to determine this. Here are some recommended resources.
UPU Addressing Solutions: Visit the UPU website (upu.int) and explore the "Postal Addressing Systems" section. Membership or registration may be required for full access.
ISO-3166-2 Database: Available via the ISO Online Browsing Platform (iso.org/obp). Free to view, but it’s not postal-specific.
National Postal Sites: Search "[country name] postal service" (e.g., "Deutsche Post," "Japan Post").
Frank’s Guide: Search online for "Frank’s Compulsive Guide to Postal Addresses" (often hosted on personal or university sites).
Commercial APIs: Check documentation from Shopify (e.g., "Shopify Address Countries and Provinces"), PayPal ("State and Province Codes"), or similar platforms.
We need to track the preference. I suggest that we add a new column to the countries table called preference. It could be an ENUM (or other) so that either "code" or "name" can be chosen. If "name" is chosen, then anywhere the address is output from the states table we would display the name instead of the code.
Update the list of countries to specify name for preference for known countries that prefer the name (requires some research).