Archive for April, 2011

Adding New Regions/States to your Magento Installation

Posted by: Josh Monday, April 4th, 2011

You may have noticed that Magento doesn’t include the Region/State information for a lot of countries. This can be particularly frustrating if you’re trying to set up your shipping rules and would rather use states than postal codes or if you just want to show a nice drop down on the front end of Magento for your customers.

There is a solution, to manually add the information to  the tables in your database. The tables are directory_country_region and directory_country_region_name.  The table directory_country_region holds the region codes and region id and then the directory_country_region_name provides the translation for you locale by using the region id  and the locale you want to provide the translation for. Magento will then pick up on this and populate a drop down list.

I’ve already done this for the UK (translated to English only). Please find the CSV files at the below links which you can upload via phpMyAdmin. Don’t forget to change the delimiter to comma rather than semi-colon as it is by default.  These are provided as is and can be freely edited.