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

Posted on July 02, 2015 | Magento 1

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');