Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

COMPLETE directory_country_region/directory_country_region_name
 
MrBaseball34
Sr. Member
 
Total Posts:  164
Joined:  2011-06-07
 

Does anyone have those 2 table that are complete with all countries and states/regions?

I have worked on this for 2 days and still can’t get every default_name correct because of the charset issues.

The Magento tables are encoded and collated utf8_general_ci but these tables need utf8_unicode_ci due to the charsets involved with having international addresses in them. What other tables need their charsets changed to store int’l addresses?

There are over 4000 regions identifiers in the ISO3166-2 std. every time I try to import the values from this table: http://www.commondatahub.com/live/geography/state_province_region/iso_3166_2_state_codes
I get values that aren’t the correct encoding.

Can anyone offer some advise?

 
Magento Community Magento Community
Magento Community
Magento Community
 
MrBaseball34
Sr. Member
 
Total Posts:  164
Joined:  2011-06-07
 

OK, based on the download from the site noted AND the ISO-3166-2 listings here: http://en.wikipedia.org/wiki/ISO_3166-2
I have imported all 4,320 country/region pairs that were not included in our base Magento 1.4.0.1 installation.

Attached is the SQL file to setup your directory_country_region and directory_country_region_name tables in Magento. Please be advised to backup your data before running this because it drops the tables and recreates them in utf8_unicode_ci charset and collation. Also, I removed our table prefix from the table names, if you have a prefix, remember to add it before running the script.
This was necessary due to the different charsets involved in all the region names.

I hope this helps someone else and Magento finally includes this info in their distribution. It is sad that they claim to be able to support international customers but don’t include this very important data.

File Attachments
Magento International Directory Country Region Tables.zip  (File Size: 87KB - Downloads: 333)
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top