There are several posts on Ubercart.org about the UK country import file we've had in core for some time now. It was a contribution originally, and I obviously didn't look through the dozens of zones to see that some were named improperly or just missing. I'm really just calling for someone with time to update the .cif to take care of all the following posts on Ubercart.org:
- Drop "Greater" from Greater London and Greater Manchester - 1
- Include Cumbria, Cleveland, and all other missed zones, including N. Ireland - 1, 2, 3, 4
The standard to use is this page on Wikipedia for zone names and abbreviations:
http://en.wikipedia.org/wiki/ISO_3166-2:GB
So, we need to update the install query and then write an update function that first modifies the names of any existing zones that were changed and then in a second query adds in the zones that weren't there in version 1.
| Comment | File | Size | Author |
|---|---|---|---|
| #24 | 326836.ubercart.uk-cif-add-channel-islands.patch | 2.24 KB | joachim |
| #18 | united_kingdom_826_2.cif-1.x.txt | 7.67 KB | Island Usurper |
| #13 | united_kingdom_826_2.cif_.txt | 7.19 KB | longwave |
| #9 | ubercart-UK-remove-zone-code.patch | 801 bytes | joachim |
Comments
Comment #1
chrisschaub commentedRyan, how do these codes map to the codes in ubercart? Where do the the "codes" for each city come from in UC? From the wikipedia article, I have codes like ...
GB-ABD|Aberdeenshire
GB-ABE|Aberdeen
...
Comment #2
rszrama commentedI believe if we're to use them, we should just use the three letter ABD, ABE, etc. as the zone_code and not include the GB- since they're being associated to the country by the ISO number, not the code. I heard there are some mislabeled codes in the current version, so updating this will require an update function to change existing data.
Comment #3
chrisschaub commentedAre the current codes in the db for UK used by anything you know of? I saw your post about WPP from Paypal. I guess these would be passed in a gateway? Also, is there any more official source than Wikipedia for this info? I was working on a diff / re-code for this, but I'm a bit worried about an American doing this sort of thing -- I'm sure a UK resident would do a better job. Anybody out there up to the task of looking over the list of zones and codes?
Comment #4
chrisschaub commentedI guess I'm wondering if these codes are even necessary?
Comment #5
longwaveI've never seen the 3-letter ISO zone codes used anywhere in the UK for addressing purposes. The county (zone) name can be left out of a UK address as long as the town/city and postcode are present, see http://www.upu.int/post_code/en/countries/GBR.pdf for details.
As per that PDF, I would recommend changing the default UK address format to the following:
To be fully correct, we would also need a new variant of !city that transforms the city field to uppercase. But this is still not quite enough for some UK addresses, which have three "street address" lines:
1A Seastone Cottages
Station Road
Weybourne
HOLT
NR25 7HG
Holt is the post town, so a customer would have to combine two of their address lines into one to enter their details into Ubercart.
I suspect most payment gateways will not validate the county name, and will only require a street address, town and postcode, as an extremely short address can be perfectly valid:
10 Downing Street
LONDON
SW1 2AA
The zone system is confused even further by the Channel Islands of Jersey and Guernsey. These use UK postcodes and address formats, but are Crown dependencies and aren't technically part of the UK. They have zone codes of GB-JSY and GB-GSY in ISO 3166-2:GB, but then they also have their own separate ISO country codes of JE and GG. The Isle of Man is in a similar situation, the Wikipedia page mentions GB-IOM but there is also an ISO country code of IM.
Comment #6
longwaveLooking through ISO 3166-2:GB again, I don't think this is suitable for using directly, as they don't correspond with what people think of as "counties" when specifying their address, these are more for administrative purposes only.
For example, no one from London would expect to select their borough (Camden, Greenwich, Lambeth etc) from a county dropdown when entering their address. Someone living in Coventry, Solihull, Sandwell, Walsall or Wolverhampton would enter that as their town name and look for West Midlands in a county dropdown - but West Midlands isn't listed as a single entry in the ISO document.
There are also entries like Ards, which I'd never heard of before, but is apparently a district of County Down - but that already has its own ISO zone code.
Maybe http://en.wikipedia.org/wiki/Postal_counties_of_the_United_Kingdom would be a better reference point?
Comment #7
rszrama commentedPostponing as it seems like the real thing to do might be to remove zones from UK altogether.
Comment #8
chrisschaub commentedOr make it a text field, not a drop down. This would help in many other countries as well since you wouldn't have to define the zones -- just let the user enter their zone name if none are predefined. This would instantly make Ubercart country files more dependable.
Comment #9
joachim commented+1 for removing zones from the UK altogether -- and seconding longwave, I've never seen these codes used in UK addresses. They will be meaningless and confusing to users.
In the first instance, could "!zone_code" be removed from the address format so at least they are hidden from users?
Here's a patch for that.
Comment #10
problue solutionsWhats the story with this?
I have a localised website in Northern Ireland which is completely missing from the United Kingdom regions, meaning I cant use ubercart.
Can I download an updated file somewhere or should I look at other carts?
Comment #11
GreyHawk commentedIs this related / same thing? Map country names in USPS from ISO-3166 to USPS value - ex: 'Korea, Republic of' and "Great Britain" and this? USPS ICL vs. ISO Country Id's
Comment #12
problue solutionsApologies for any ignorance to the technical details involved with this issue, but I'm being completely honest here when i say its ridiculous to suggest that ubercart is a realistic solution for a business if essential things like this are missing, totally baffled how this is not considered a critical problem and corrected as a matter of urgency!
Comment #13
longwaveAttached is my attempt at version 2 of the UK country data file. This includes the following changes:
I was also going to add Humberside as I've seen it in several county dropdowns on other sites, but this is not included for now on joachim's advice.
Comment #14
joachim commentedYup, FYI Humberside was a short-lived country from the early 1970s to the early 1990s. It was generally unliked and was the subject of many campaigns for its abolition. It is still present in many sites' databases because they're using crappy old datasets they bought 20 years ago. At least one MP in the area is campaigning to get it removed from mailing addresses and the like. We *really* don't want it! :)
Comment #15
problue solutionscan that country data file not be used with ubercart 1.x?
getting the following error when importing...
Comment #16
Island Usurper commentedCommitted the changes in #13, though with the address format that was requested in #474458: don't output meaningless region codes.
Comment #17
longwaveThanks for applying my changes :)
thiokol's issue is that they were trying to import a UC 2.x country file into UC 1, which won't work because the primary key has since changed on uc_zones and a call to uc_get_zone_ids() was needed instead in the previous version. I'll try to find time to make a version 2 of the UK country file for UC 1 soon.
Comment #18
Island Usurper commentedDon't worry about it, I figured out the problem, and got it fixed. This file has been committed to the 1.x branch.
Comment #19
kangaroobin commentedHello, I am not a programmer but have figured out how to use most of drupal, therefore I do not know what to do with this patch in number 18.
Is anyone able to help me, and is there any conformation that this will fix the problem with usps shipping to the UK?
Thanks,
Reuben
Comment #20
kangaroobin commentedAlright I figured out where to put that file and how to update it however I got this warning:
user warning: Column count doesn't match value count at row 1 query: INSERT INTO drup_uc_zones (zone_id, zone_country_id, zone_code, zone_name) VALUES (826, 'AVON', 'Avon'),(826, 'COAN', 'County Antrim'),(826, 'COAR', 'County Armagh'),(826, 'CODN', 'County Down'),(826, 'COFE', 'County Fermanagh'),(826, 'COLO', 'County Londonderry'),(826, 'COTY', 'County Tyrone'),(826, 'CLVD', 'Cleveland'),(826, 'IOS', 'Isles of Scilly'),(826, 'MIDDX', 'Middlesex') in /home2/moptopme/public_html/includes/database.mysql.inc on line 174.
Can someone please help?
Thanks
Comment #22
dbassendine commentedAs Guernsey and Jersey now have their own ISO-3166-1 codes, I have created separate .cif files for each. For Guernsey, please see http://www.ubercart.org/contrib/14721, and for Jersey see http://www.ubercart.org/contrib/14722.
Thanks, David.
Comment #23
joachim commentedReopening for the Channel Islands to be included in the UK:
- they have UK postcodes
- both Amazon.co.uk and Tesco -- two pretty large UK online retailers -- include Jersey and Guernsey within the UK. Whether they have a different ISO-3166-1 code is less important than what customers expect from other sites.
Comment #24
joachim commentedHere is a patch to add the Channel Islands to the UK CIF.
Comment #25
joachim commentedTurns out it's rather more complicated than that; also the patch doesn't work :D
Comment #26
chriscohen commentedI'm from Jersey and lived there for 19 years. Ordering online was always a pain because some sites wanted you to use UK as the country, while others had an entry for Jersey. There are arguments for doing it both ways:
The Channel Islands should be their own countries
The Channel Islands should appear as counties of the UK
I appreciate it might not be much help, but I honestly have no idea which method would be easier, and there seems to be an absence of black and white guidelines on the issue.
Comment #27
tr commentedAs noted in #25, the offered patch doesn't work.
Waiting for someone to create a patch that can be tested ...
Comment #28
joachim commentedWe need to figure out the best way to include these first...
Comment #29
kingandyAny movement on the Channel Islands? I'm going to use David's CIF's from #22, but would encourage a more permanent fix.
Comment #30
mo6I'm trying to develop a shipping quote module for a local company (TNT Post in the Netherlands) where I need to differentiate between the UK and the Channel Islands (or Gibraltar). The easiest way to do this is to give them different country definitions. Shipping companies from the UK probably will see Jersey and Guernsey as a province, but shipping companies from outside the UK see the islands as a more autonomous destination. Actually shipping costs to China and Jersey are the same from the Netherlands :)
Comment #31
oglord commentedThe ISO3166-2 codes are not what people think of as their geography. For example it's a bit silly saying the city of Newport is in Newport! The canonical list of the 92 geographical counties is:
Comment #32
longwave@oglord: you also need to include the metropolitan counties, otherwise Birmingham and Manchester residents don't have a reasonable choice. What's the problem with the current list used by Ubercart?
Regarding the Channel Islands issue, I have Jersey and Guernsey selectable as separate countries, and have a CA condition that checks for these along with country code UK and postcodes beginning with JE or GY; this allows shipping rules to work no matter how the user enters their address.
Comment #33
dwkitchen commentedOn a selection of the issues here:
It is better for me to have Jersey and Guernsey as separate countries in Ubercart; as although from the UK the shipping rate is the same (Royal Mail), they are not part of the EU VAT Zone.
So orders from Jersey pay no VAT, unlike orders from within the UK as well as France, Germany etc. do.
The other issue of !zone_code is it possible to display the full zone name in the address instead of the code or nothing at all?
David
Comment #34
arne.olafson commentedHas Northern Ireland been left out for good here? It seems like there's room for development or discussion.
Comment #35
rszrama commentedIt should support any country defined by the core country list module. Is Northern Ireland selectable as the default country of a site?
Comment #36
arne.olafson commentedNorthern Ireland is not currently available as a separate country nor are the Northern Ireland counties available to the 6.x.dev or 6.x branches. This seems like a major oversight.
Here are the missing counties:
County Antrim, County Armagh, County Down, County Fermanagh, County Londonderry, County Tyrone
(from wikipedia)
Comment #37
rszrama commentedCrap, my bad. I thought this was the Address Field queue for Drupal Commerce. I can't help you with Ubercart .cif's any more, and I sure am glad we left those behind. : P
Comment #38
arne.olafson commentedNorthern Ireland Counties are listed alphabetically, in order, as:
County Antrim
County Armagh
.. etc.
Comment #39
problue solutionsI'm subscribed to this thread from a long time ago, just so happens I was doing some shipping quotes tonight that required the Northern Ireland counties. The counties are there in the UK .cif in the last copy of ubercart 6.x dev I downloaded, couldn't have been more than 2 weeks since I downloaded it I think. strange that they would be removed. You sure they arent there? They are listed differently to other UK counties, the NI counties are all prefixed with "County" whereas the rest are not. This is actually good imo, as in NI they are refered to as County Down, County Armagh etc, but in England they drop the word "County".
Comment #40
problue solutionsFound 'em then :P
Comment #41
problue solutionsIt would actually be confusing to anyone outside of NI how they are listed, but it makes sense, at least for customers to any store I've worked on based in NI, they automatically look for "County...". It's almost as if it was someone from NI contributed that addition to the .cif file, maybe it was!
Comment #42
longwaveRetitling this, as the UK country file is complete as far as I can tell, except for the Jersey/Guernsey issue described in #26.
Comment #43
longwaveOh, since #1070342: Add missing CIF files, turns out that Jersey and Guernsey are now included as countries anyway, so I don't think there is anything left to do here.