PuzzlersWorld.com

  • Hacker Puzzle
  • Interview Puzzles
  • Number Puzzles
  • Maths Puzzles

How to add new Region/State in Magento

(3 votes, average: 1.00 out of 5)

March 2, 2013 by puzzler 4 Comments

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

Import above csv files using phpmyadmin:-

  1. Select mgn_direcotry_country_region table
  2. Go to import
  3. Select CSV option in the dropdown under Format section
  4. Browse to your directory_country_region.csv file
  5. and Push the “GO” button
How to import csv in phpmyadmin

How to import csv in phpmyadmin

  • Share on Whatsapp
  • Share on Facebook
  • Share on Twitter
Facebook Comments
Next Puzzle
Master password hint

Checkout more Technical Tags: Magento

Comments

  1. amar says

    December 30, 2014 at 1:00 am

    ek number. just need to update as they are not in alphabetical order and there is no chandhigadh….thank you…..

    Reply
  2. Lady's Moldova says

    June 19, 2014 at 6:55 am

    Hi. I have to add some more States for a Country ex. Romania
    In my website I a use the Language of the site “romanian” (locale ro_RO) but in the directory_contry_regions_name appear locale only en_EN (that is English). In this website I will not use multilanguage.
    Do I have to change also the: directory_coutry_regions_name ???

    Reply
  3. Jhon Velez says

    May 6, 2014 at 2:50 pm

    Great Post!!
    Thank you so much

    Reply
    • puzzlersworld says

      May 6, 2014 at 6:20 pm

      Thanks, Glad you liked it 🙂

      Reply

Leave a Comment Cancel reply

Submit your Puzzle

You may also like

  • Master password hint
  • HTML Escape | Escape Characters
  • How to add new Region/State in Magento
  • 8 Steps guide on How to create Magento module
  • Before you start development on magento
  • Magento Plugin for Twitter Card

Categories

  • Aive hi Puzzles
  • Akbar and Birbal
  • Alphabetical Puzzles
  • Bollywood Puzzles
  • Google Code jam
  • Hindi Riddles
  • Interview Puzzles
  • Interview Questions
  • Logical Puzzles
  • Malayalam Puzzles
  • Maths Puzzles
  • Miscellaneous
  • Number Puzzles
  • Picture Puzzles
  • Riddles
  • Tamil Puzzles
  • Technical

Social

  • View puzzlersworld’s profile on Twitter
privacy policy

Copyright © 2025 · eleven40 Pro Theme on Genesis Framework · WordPress · Log in

  • Hacker Puzzle
  • Logo Puzzles
  • Optical Illusions
  • WhatsApp Puzzles
  • Picture Puzzles
  • Riddles
    â–¼
    • Hindi Riddles
  • Bollywood Puzzles
  • Alphabetical Puzzles
  • Aive hi Puzzles
  • Interview Puzzles
  • Logical Puzzles
  • Interview Questions
    â–¼
    • Data Structures
    • Binary Tree
    • Algorithms
    • Recursion Questions
    • Amazon Interview Questions
    • Snapdeal Interview Questions
    • Google Code jam
  • Technical
  • Akbar and Birbal
  • Number Puzzles
  • Maths Puzzles
  • Miscellaneous