Country- and zone update

Posts: 166
Joined: 08/13/2007
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer

I repost an sql import that make's all(?) countries and their zone's available to Ubercart.

Truncate the MYSQL tables: uc_zones and uc_countries
Then import the attached file (run as SQL code in f.e. phpMyadmin)

I think this could be in core.

Regards,

Kees

Web development, web applicaties, internet winkel

AttachmentSize
world_zones.txt254.51 KB
Posts: 1968
Joined: 08/07/2007
AdministratoreLiTe!

Thanks, Kees. Our copy of that file got corrupted in the server crash, so we couldn't repost it.

Posts: 166
Joined: 08/13/2007
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer

He man,

Anytime. Blame your shitty server crash. Did your smile crash to on your avatar Eye-wink ?

Posts: 95
Joined: 08/08/2007
Getting busy with the Ubercode.Internationalizationizer

haha, kees, i noticed that too! lyle's avatar suddenly looked very sober after the crash...

Posts: 79
Joined: 08/12/2007
Uber DonorBug FinderInternationalizationizer
Posts: 95
Joined: 08/08/2007
Getting busy with the Ubercode.Internationalizationizer

is it just me or does anyone else see something strange with the zone names containing special characters? the first of the german zones, for example, and a few in france, metropolitan? on my system, the special characters are displayed as you would see them in html. ampersand-uuml-semicolon, etc.

Posts: 79
Joined: 08/12/2007
Uber DonorBug FinderInternationalizationizer

I have the same problem.

In DB:
Württemberg

Generated source:
Württemberg

So its a problem with the output of the &-Character

Posts: 166
Joined: 08/13/2007
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer

This has to do with the fact this list comes straight from osCommerce. Drupal filters apparently the "&" char and replaces it whith "&" I adapted the SQL code by replacing all html special chars by their unicode equivalents.

Pleas test if this breaks zone-display somewhere else in Ubercart (like in orders or...)

Kees

AttachmentSize
world_zones2p0.txt254.18 KB
Posts: 166
Joined: 08/13/2007
Cool profile pic award.Getting busy with the Ubercode.Internationalizationizer

strange, it might be just my setup, but in my phpMyadmin I have to run the SQL code by copy/pasting the contents to the interface instead of looking up the file itself by [browse]. The latter breaks strings containing the special chars.

Posts: 95
Joined: 08/08/2007
Getting busy with the Ubercode.Internationalizationizer

thanks, kees!

i also had a problem with the second file, though, so i'm putting this one up in case anyone else has problems with keesje's ones. i had to copy and paste it into the SQL window, too.

AttachmentSize
world_zones3.txt254.25 KB
Posts: 69
Joined: 08/08/2007
Internationalizationizer

Hi,
I'm poking through the phpmyadmin window and whatever docs I can find,
and I don't see any truncate button (or other means).

Can someone help and tell me how to accomplish the truncate op ?

Thanks,
DK

Posts: 1968
Joined: 08/07/2007
AdministratoreLiTe!

It's the red "Empty" button. It'll show an alert message with "Do you really want to TRUNCATE table name?"

Posts: 85
Joined: 09/08/2007
Bug Finder

hmmm... can anyone you give a full workflow on how to import this?

Posts: 81
Joined: 08/31/2007
Bug FinderInternationalizationizerNot KulvikThe other woman.

Hi! I was just wondering if the files here are still wholly based on OsCommerce's world_zones? Or have they been updated with the country files that have been added to Ubercart?

Posts: 95
Joined: 08/08/2007
Getting busy with the Ubercode.Internationalizationizer

amitaibu:

1. go to php myadmin page in your favourite web browser;

2. select your drupal database;

3. browse to uc_countries;

4. click 'empty' in the tabs above the table;

5. an alert will ask you if you're sure you want to truncate the uc_countries table, click ok;

6. click 'sql' in the tabs above the table;

7. you should see a large text field labeled "run sql query/queries on databasename". delete any default text in this field and copy and paste the sql out of the text document you downloaded from this forum topic. this is what you should copy:

INSERT INTO `uc_countries` VALUES (1, 'Afghanistan', 'AF', 'AFG', 1);
INSERT INTO `uc_countries` VALUES (2, 'Albania', 'AL', 'ALB', 1);
...
and so on until the end of the 'uc_countries' inserts

8. repeat steps 3-7 for uc_zones.

hope that helps!

Posts: 85
Joined: 09/08/2007
Bug Finder

megg rules Eye-wink

Posts: 7
Joined: 08/18/2007

Hmm, whilst setting up my store the first thing I noticed is that the county of Cumbria is missing from the UK zone (because I live there).

I've done a little more digging and can see that also missing is the Isle of Man, Jersey and Guernsey. There may be others.

In fact I believe that the Royal Mail only use post codes and do not recommend using postal counties for addresses therefore I suspect it will be confusing to customers who cannot enter their known and trusted addresses if the option is mandatory and the list is pre-defined.

Perhaps the zone field could be left greyed out upon selection of the UK in the countries field?

Posts: 4117
Joined: 08/07/2007
AdministratorHead Code Monkey - I eat bugs.

Hmm, sorry the file is incomplete. I of course would have no way of checking, but I have made the address forms on the checkout page configurable. You can turn off the zone field altogether at /admin/store/settings/checkout/edit/fields.

Posts: 81
Joined: 08/31/2007
Bug FinderInternationalizationizerNot KulvikThe other woman.

i've looked over the file and i think that it should be mentioned that people using this file shouldn't use (or rather, use with caution) the importable country files that are part of ubercart. as they might cause some conflicts.

i 'fixed' the country file for the philippines and i made some changes to it based on the internationalization notes and ISOs (i even added some other provinces!) that were discussed on the old forum boards. as an example, the philippines' zone/country code in the oscommerce file is 168 and it's 608 in the file that i 'fixed'. so be careful with them files. Smiling

Posts: 20
Joined: 10/01/2007

The countries file attached previously in this thread is incompatible with the country files that come with ubercart core. Using this may break things like existing customers, shipping rules etc.

The attached file contains information on all countries (source: iso3166-1), with country id's as defined in ISO, and is compatble with ubercart core files. It does not contain information about zones.

You can import this into your database and it will not remove existing zones you might have imported from ubercart core. You can also import new zones - just disable the relevant country and import it.

I find this good enough for me, since I do need a list of all countries, but not all zones in the world (US, CA are good enough for now.. if more are needed, I'll import them).

AttachmentSize
iso3166-1.sql_.txt15.81 KB
Posts: 81
Joined: 08/31/2007
Bug FinderInternationalizationizerNot KulvikThe other woman.

great! maybe we can just add an empty field for the zones of the other countries (those without zones in the db)?

Posts: 4
Joined: 02/14/2008

Great, thanks a lot! Perhaps a link to your post should be included in the docs?

Posts: 291
Joined: 08/28/2007
Early adopter... addicted to alphas.Not KulvikTheminator

That .sql file contains Yugoslavia which leads me to believe it's outdated. Anyone know different?

Posts: 291
Joined: 08/28/2007
Early adopter... addicted to alphas.Not KulvikTheminator

I have noticed that there is no Cleveland or Redcar and Cleveland options. I live there and have been trying to figure out what zones actually exist. I've found it hard to find solid info online about it. We need the zones so we can show different payment modules for different zones within the UK.

Posts: 9
Joined: 03/22/2008

Well I believe that it's not a problem since Serbia and Macedonia are listed as well.

Kosovo is missing ("de jure" still part of Serbia), probably they don't yet have seperate postal addresses so that won't make any problem either.

--

Tom Szigeti

Posts: 9
Joined: 03/22/2008

Hungary's zones in this file are a crazy mix of counties and a few cities _and_ we don't need to include the county name in postal address at all. I've just started to play around with Übercart and I really like it but I found this part quite flaky. I'll simply go with the full list of countries with an optional State/Region field.

--

Tom Szigeti

Posts: 744
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

TomIslander wrote:

I'll simply go with the full list of countries with an optional State/Region field.

That's what I've done too, for similar reasons. I have customers in 53 countries other than the US, and trying to impose Zones is more trouble than it's worth.

--

<tr>.

Posts: 9
Joined: 03/22/2008

May I ask that how specifically did you implement the custom address field?

--

Tom Szigeti