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

Add Default Values to System Configuration Fields

Add the following snippet to your
Namespace/Module/etc/config.xml file.

<?xml version="1.0"?>
                <fieldname>My Default Value</fieldname>         
                <fieldname>My Default Value</fieldname>
                <fieldname>My Default Value</fieldname>

Add Mobile Attribute to Customer Account

The following instructions will add a new customer attribute called Mobile.  This attribute will be added to the Customer information only, it will not be added to the Customer Address.

Apologies for the pastebin links, my syntax highlighter is currently out of action.

Create the following files:


Add the following content to files:


See for content:


See for content:


See for content:


See for content:

Once you have uploaded these files and clear your cache you will notice a new Mobile input field available in the customer admin section (Customers/Manage Customers/Click Customer/Click Account Information).

Screen Shot 2015-01-21 at 16.00.50

Mobile Number is now added to the customer account.

 Adding Mobile to Customer Account Edit Form.

Create/Edit: app/design/frontend/yourpackage/yourtheme/template/customer/form/edit.phtml

See for Content:

Insert  the above code around line 46 before  <?php $_dob = $this->getLayout()->createBlock(‘customer/widget_dob’) ?>

Screen Shot 2015-01-21 at 16.20.23

 Adding Mobile to Customer Registration form.

Create/Edit: app/design/frontend/yourpackage/yourtheme/template/persistent/customer/form/register.phtml

See for Content:

Insert  the above code around line 57 before  <?php $_dob = $this->getLayout()->createBlock(‘customer/widget_dob’) ?>

Screen Shot 2015-01-21 at 16.28.18

You and your customers should now be able to add/edit their mobile number.

Please note this has only been tested on Magento

Add a Custom CMS Layout Template in Magento

To add a custom template to Magento is quite simple. Please find simple instructions below:

1. Create a new module

Create the following folder path


Create a file called config.xml in app/code/local/PaulDonnelly/NewTemplates/etc/

Add the following snippet to config.xml

<?xml version=”1.0″?>
<label>Name of your Template e.g. Standard CMS Page (One Column Left)</label>

2. Create the Template File

Create a file called standard-onecol-left.phtml in


You will most likely be using an existing template as a starting point. Just copy the contents from 1column.phtml, 2column-left.phtml, 2columns-right.phtml or 3columns.phtml into standard-onecol-left.phtml. In our example we will be copying the contents of 2column-left.phtml.

3. Activate your new module and CMS Layout

Create a file called PaulDonnelly_NewTemplates.xml in app/etc/modules/

Add the following snippet

<?xml version=”1.0″?>

Upload your new module and you will see a new CMS page listed.

Add a Custom CMS Layout Template in Magento

Turn off Cache for Individual Blocks in Magento

Turn off block caching while declaring the XML block

<action method="unsetData"><key>cache_lifetime</key></action>
<action method="unsetData"><key>cache_tags</key></action>

In your local.xml file:

   <reference name="footer">
     <action method="unsetData"><key>cache_lifetime</key></action>
     <action method="unsetData"><key>cache_tags</key></action>
    <block type="mymodule/mymodule_block" name="module_name" as="module_name_alias" template="mymodule/uncached_block.phtml" after="-" />

Notes: Sourced from