-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
States seed data: Use Carmen "state" type #1378
Comments
I've seen the need for subregions in Italy (where shipping depends on the region) as well as the Netherlands (where Paypal obscurely needs subregion data). In Italy the states are typed "region" in Carmen, but they're still necessary. I wouldn't go this route, especially as even a large states table is not a big performance issue. Lastly, the The |
Thanks @mamhoff for the feedback. You're right, I didn't go into the nitty gritty of the countries that were not states but for which the subregion was needed for shipping. And |
A correction about Italy: there are |
Just as a reference, this seems interesting as well: https://github.com/hexorx/countries |
The subdivisions there seem to make sense for Italy and the US, not sure about other countries. I don't know if there's an easy way to figure out if a data source has the right information for (most of) the entire world... |
This looks more or less like the issue with first/last names, reading through https://en.wikipedia.org/wiki/Address it's not easy to cover the whole world. A better solution would probably be to have an external service like google maps, melissa.com, or one of the many others to correct/normalize the address, than it can at least be consistent within the same store. At that point we'd probably need to also change a bunch of things within cc @seand7565 / #3670 |
Unless we go with an external service, I think the only way to handle this accurately is going to be to go through each of the "problem" countries and fix them by hand. I've attempted to do that with Italy with this PR: #3722 - but it does take a lot of effort if you're not already familiar with address requirements for a particular area. The |
Closing this in favor of having all the info in a single place: #3842 |
Note: This is a tiny suggestion for which I can make a PR.
The states seed data is often irrelevant for most countries. It loads "states" that are not states for most countries, and then sets a
states_required
flag that doesn't make sense.E.g.: I'm from France, and the abbreviations have no meaning whatsoever (because we don't have any), it's just been alphabetical order. A, B, C,... On top of it, our regions have never been used for shipping/billing and are outdated in Carmen's database.
I've been looking at the Carmen data, and discovered they were making a distinction between states and other types of geographical divisions. All you have to do is to explicitly require the subregions labeled "state" for a given country, and not all the subregions.
The US and a few other countries (around 10) would end up with states.
So my 2 cents question is:
Why not using
carmen_country.subregions.typed('state')
instead ofcarmen_country.subregions
? (Solidus seed code here and there)I know most storefronts end up tweaking and putting their own data, but in Solidus' effort to be more international-friendly, I think this would make sense. On top of it, our
spree_states
table would be then filled with... well states.The text was updated successfully, but these errors were encountered: