Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves how the data is pulled from the Carmen Gem into Spree, as far as I can tell, Carmen is set up strictly to follow ISO standards and has the following setups depending on the country.
US, AU examples
Italy, Spain examples
For this PR I am referencing what Shopify use on their checkout systems, and PayPal Checkout to match what Countries require States, and what states are pulled in from the Carmen gem.
17 Countries Require States at checkout.
A ticked checkbox below means the states have been cross referenced against Shopify and PayPal Checkouts and they list the correct states in Spree.
Australia -- (8 States)
Brazil -- (27 states)
Canada -- (13 States)
China -- (31 States)
India -- (36 States)
Ireland -- (26 States)
Italy -- (110 Provinces)
Malaysia -- (16 States)
Mexico -- (32 States)
New Zealand -- (17 States)
Portugal -- (20 States)
Romania -- (42 States)
South Africa -- (9 States)
Spain -- (52 States)
Thailand -- (77 States)
United Arab Emirates -- (7 Emirates)
United States -- (50 states, one postal district DC, and 3 APO's -- 54 total)
Sorting Valid Countries From Disputed Territories and Uninhabited Islands
There are 195 official countries in the world as of writing in 2020, but the ISO standards have 249 country codes taking into account some random territories and uninhabited islands.
Most shippers will list around 234 (DHL) to 238(Fedex)
Somewhere in amongst these country lists lay some sensible setup for a checkout system, after viewing Shopify it appears they are also using a modified version of the Carmen gem for their list of countries, and list uninhabited islands at checkout, the intention is now to do better than Shopify at producing a valid list of countries for a checkout system.