Magento – Add Northern Ireland, England, Scotland and Wales as State/Province for the United Kingdom

I’ve worked on many projects which needed the customer to fill out which part of the UK they where from. This allowed the administrators to target those customers by region or block sales of a particular products in a region.

By default magento leaves the state/province blank for the UK but you can easily add Northern Ireland, England, Scotland & Wales.

Please note, the following code assumes you havent added fields to these tables (directory_country_region or directory_country_region_name) before. If you have, adjust the id’s in the sql code.

Remember to take a BACKUP of YOUR DATABASE before running these commands!!!

INSERT INTO `directory_country_region` (`region_id`, `country_id`, `code`, `default_name`) VALUES
(488, 'GB', 'WLS', 'Wales'),
(487, 'GB', 'SCT', 'Scotland'),
(486, 'GB', 'ENG', 'England'),
(485, 'GB', 'NIR', 'Northern Ireland');
INSERT INTO `directory_country_region_name` (`locale`, `region_id`, `name`) VALUES
('en_US', 488, 'Wales'),
('en_US', 487, 'Scotland'),
('en_US', 486, 'England'),
('en_US', 485, 'Northern Ireland');
ShareShare on Facebook0Tweet about this on TwitterShare on Google+0Share on LinkedIn0Share on Reddit0Share on StumbleUpon0

Published by

Paul Donnelly

Hi I'm Paul, an avid Magento Developer from Northern Ireland. With almost 8 years of Magento experience under my belt, I still have a strong passion for it. By day I work as a Senior Ecommerce Developer for one of the top web development agencies in Northern Ireland, Pale Blue Dot. If you'd like to keep up to date with my latest posts and rants, you can follow me on Twitter: @PaulDonnelly

Leave a Reply

Your email address will not be published. Required fields are marked *

2 × 1 =