Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Carmen Data Import #10483

Merged
merged 3 commits into from
Sep 18, 2020
Merged

Improve Carmen Data Import #10483

merged 3 commits into from
Sep 18, 2020

Conversation

MatthewKennedy
Copy link
Contributor

@MatthewKennedy MatthewKennedy commented Sep 12, 2020

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

--country
  --state

Italy, Spain examples

--country
  --region
    --province 

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.

  • Antarctica (not a shippable location).
  • South Georgia and the South Sandwich Islands (inhospitable islands)
  • United States Minor Outlying Islands (all listed islands are uninhabited)
  • Åland Islands (Cant seem to find it on a DHL list or any other respectable shipping list.)
  • Heard Island and McDonald Islands (Un-shippable location)
  • British Indian Ocean Territory (Un-shippable location)
  • Western Sahara (disputed territory, not on any known shipping lists)
  • Bouvet Island (Small island in the middle of the Atlantic, population 0)
  • French Southern Territories (Arctic islands no shipping)

@squash-labs
Copy link

squash-labs bot commented Sep 12, 2020

Manage this branch in Squash

Test this branch here: https://matthewkennedyimprove-carmen-i-aidsz.squash.io

@MatthewKennedy MatthewKennedy marked this pull request as draft September 12, 2020 14:45
@MatthewKennedy MatthewKennedy marked this pull request as ready for review September 13, 2020 11:48
core/db/default/spree/countries.rb Outdated Show resolved Hide resolved
core/db/default/spree/states.rb Outdated Show resolved Hide resolved
core/db/default/spree/states.rb Outdated Show resolved Hide resolved
@damianlegawiec
Copy link
Member

@MatthewKennedy left some comments - as always, amazing work! Thank you 🙏

@damianlegawiec damianlegawiec merged commit 30d80c5 into spree:master Sep 18, 2020
@MatthewKennedy MatthewKennedy deleted the improve-carmen-import branch September 22, 2020 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants