Import Region - Magento 1

Import Region for countries


In magento, there are several countries for which states/regions already available, but for others like India, New-zealand and many more have not region list available. However, an input type text is available to enter state/region manually. 

Usually, it is always better to have selectable state from the list. Actually, it is more convenient to use dropdown as region/states selection country-wise. 

Simply take an example of India where a user has to enter states/regions manually. Now need to convert it into dropdown require SQL script and prepare this script. These all seem hectic. 

It would be very appropriate if a developer can do this by CSV and piece of code. Well, here is the solution to it which is illustrate below.

Firstly, need a csv file to this. For an example India's states CSV is below.

Download CSV file from here → Indian Regions

To download the file as CSV, follow below steps:
  1. Go to link.
  2. Select File from top-left.
  3. Download as -> Comma -Separated Values (.csv)


















Secondaly, need a script to perform the task.

Script available → Import Region

How to import regions using the script?

The script and CSV file both should be in the same hierarchy means both are should be on root directory of magento.

Run this script from magento root directory.

Imported regions successfully!! Cheers!!


Please share, comment and subscribe for future posts.

Comments

Popular posts from this blog

Hosting and Goodies

Magento 2 Import Scripts

How to add product attribute value in minicart magento 2