Magento by default has states only for few selected countries and you might want to include your country’s states in your site for various purpose, to give a select option in state on checkout page, to configure some rules etc.
There is no direct UI available as of now but otherwise also it is quite simple to upload this information using a CSV file and phpmyadmin. you need two to create two csv files
Step 1: directory_country_region.csv => this should include four colums region_id, country_id(in ISO-2), region code, region name.
region_id is nothing but auto incrmented id directory_country_region table, so fill this column with incremented numbers(greater then current auto_increment number)
country_id > ISO-2 code, ex. US, UK, IN
region_code => You can fill iso-2 codes for states(find it using google)
region_name => default name for the state
Step 2: directory_country_regions_name.csv => this should include 3 columns locale, region_id and region_name
locale => ex. en_us etc.
take region_id from previous file and change the default name to the locale.
It is not compulsory to fill this table, you can skip it, unless you want to support multiple locale.
I have created sample files for Indian states, directory_country_region_IN.csv and directory_country_regions_name_IN.csv
[Read more…]