How To Add States or Provinces in Magento For India

The states or provinces of India are not present by default in Magento 1.7 or older versions. If you want to include the states or territories in the checkout process or during registration, you will need to do it manually using SQL (phpMyAdmin). It’s an easy task taking less than a second to complete.

Note: Before continuing backup the database first, in case anything untoward happens, we can easily revert back.

So here are the steps to include States or Provinces of India Inside Magento 1.7 or below:

1. Login to the Cpanel and go to phpMyAdmin

2. Select the database in which your magento installation is running.

3. Go to SQL.

4. Now here you will need to run the following code:

INSERT INTO `directory_country_region` VALUES
(NULL , "IN", "Andaman Nicobar","Andaman Nicobar"),
(NULL , "IN", "Andhra Pradesh","Andhra Pradesh"),
(NULL , "IN", "Arunachal Pradesh","Arunachal Pradesh"),
(NULL , "IN", "Assam","Assam"),
(NULL , "IN", "Bihar","Bihar"),
(NULL , "IN", "Chandigarh","Chandigarh"),
(NULL , "IN", "Chhattisgarh","Chhattisgarh"),
(NULL , "IN", "Dadra Nagar Haveli","Dadra Nagar Haveli"),
(NULL , "IN", "Daman Diu","Daman Diu"),
(NULL , "IN", "Delhi","Delhi"),
(NULL , "IN", "Goa","Goa"),
(NULL , "IN", "Gujarat","Gujarat"),
(NULL , "IN", "Haryana","Haryana"),
(NULL , "IN", "Himachal Pradesh","Himachal Pradesh"),
(NULL , "IN", "Jammu Kashmir","Jammu Kashmir"),
(NULL , "IN", "Jharkhand","Jharkhand"),
(NULL , "IN", "Karnataka","Karnataka"),
(NULL , "IN", "Kerala","Kerala"),
(NULL , "IN", "Lakshadweep","Lakshadweep"),
(NULL , "IN", "Madhya Pradesh","Madhya Pradesh"),
(NULL , "IN", "Maharashtra","Maharashtra"),
(NULL , "IN", "Manipur","Manipur"),
(NULL , "IN", "Meghalaya","Meghalaya"),
(NULL , "IN", "Mizoram","Mizoram"),
(NULL , "IN", "Nagaland","Nagaland"),
(NULL , "IN", "Orissa","Orissa"),
(NULL , "IN", "Pondicherry","Pondicherry"),
(NULL , "IN", "Punjab","Punjab"),
(NULL , "IN", "Rajasthan","Rajasthan"),
(NULL , "IN", "Sikkim","Sikkim"),
(NULL , "IN", "Tamil Nadu","Tamil Nadu"),
(NULL , "IN", "Tripura","Tripura"),
(NULL , "IN", "Uttar Pradesh","Uttar Pradesh"),
(NULL , "IN", "Uttarakhand","Uttarakhand"),
(NULL , "IN", "West Bengal","West Bengal");
 
INSERT INTO `directory_country_region_name` (`locale` ,`region_id` ,`name` ) 
    SELECT 'en_US', tmp.region_id, tmp.default_name FROM `directory_country_region` 
        AS tmp WHERE tmp.country_id='IN';

[progress size=”80″ variation=”progress-success” striped=”progress-striped” animated=”active”]

The above SQL code will add States of India in directory_country_region and directory_country_region_name tables.

[icons icon=”icon-check” color=”#3f992f” size=”18″]That completes the task. Now you have States of India inside the Magento database. Users can now select the State from which he/she belongs using the drop down list.

Related posts

[SOLVED] UNQ_SALES_FLAT_ORDER_INCREMENT_ID in Magento

How To Change Order Prefix And Default Value Of Order/Shipment/Invoice Number/Credit Memo In Magento