Irish county codes for forms and autocomplete functionality

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
Dublin Drupaller's picture

I Just submitted a patch for the Drupal eCommerce which included a localisation patch for Irish counties - so autocomplete forms work when a customer from the Island of Ireland is selecting their county (state).

This is by no means an official list. It's a list I compiled myself using the county codes from car registration plates as the basis.

If anyone knows of an official county code list for Ireland, please post a reply up here.

Code   County    Province    
-----------------------------------
AM       Antrim       Ulster
AH       Armagh     Ulster
C          Cork           Munster          
CE        Clare          Munster          
CN        Cavan        Ulster           
CW        Carlow         Leinster         
D          Dublin          Leinster         
DL        Donegal       Ulster
DN       Down            Ulster
DY        Derry            Ulster
FH        Fermanagh  Ulster
GW       Galway         Connacht         
KE        Kildare          Leinster         
KK        Kilkenny        Leinster         
KY        Kerry             Munster 
LD        Longford       Leinster         
LH        Louth            Leinster         
LK         Limerick       Munster          
LM        Leitrim          Connacht         
LS        Laois              Leinster         
MH       Meath             Leinster         
MN       Monaghan      Ulster           
MO       Mayo              Connacht         
OY        Offaly              Leinster         
RN        Roscommon   Connacht         
SO        Sligo               Connacht         
TE         Tyrone             Ulster
TN         Tipperary N     Munster          
TS         Tipperary S      Munster          
WD       Waterford      Munster          
WH       Westmeath      Leinster         
WW       Wicklow        Leinster         
WX       Wexford        Leinster 

Note: I notice on some sites I'm involved with there is an increase in people choosing Ireland instead of the UK as their country along with their postcode (particularly following when the United Kingdom was devolved - Northern Ireland assembly came together 8th may 2007) , so, NI counties are included to encompass Antrim, Armagh, Down, Derry, Fermanagh and Tyrone.

I have attached a county code array in a TXT file to make it easier to copy across the list of codes and counties.

cheers

dub

Comments

Wikipedia?

markus_petrux's picture

http://en.wikipedia.org/wiki/Counties_of_Ireland

I don't know how eCommerce works, but there's a module that implements the list of all countries and provinces/states/territories in the world (or at least they claim that :), and maybe they could also add support for counties:

http://drupal.org/project/addresses

ARGH

handelaar's picture

In an ecommerce context can someone explain to me why ON EARTH the list would include six counties whose postal addresses are not served by An Post? And which exist in the UK postcode file? And which are understood by every postal service on Earth to not be part of Ireland?

Other than listing GAA clubs I can't imagine a website where this file wouldn't be considered harmful.

some background...

Dublin Drupaller's picture

The quick answer is because I've noticed it causes problems on ecommerce sites, particularly sites servicing customers on the Island of Ireland.

For example, if a customer from Northern Ireland chooses the UK as their country, they won't see the list of counties in the autocomplete field. However, if they don't choose the UK as their country (which is what I have noticed with many NI customers) there is no county list for them to choose from...which can stall the order if state/county is a required field..

why ON EARTH the list would include six counties whose postal addresses are not served by An Post?

those six counties are served by An Post, via royal mail and are also served by courier companies. They have been for decades.

Do you honestly think that An Post would refuse to pass on an order to Royal Mail in Northern Ireland because the label was addressed County Armagh, Ireland? Or that the Royal Mail (who requires the county if the postcode hasn't been provided) would collapse from confusion if An Post forwarded on a parcel like that?

They are simply stamped with the words "Northern Ireland" at the An Post sorting office and moved along.

I've worked with a lot of ecommerce sites servicing customers from the Island of Ireland, online music shops in particular and I have observed many orders from NI that are addressed as Ireland and I have never heard of the deliveries not getting through.

It's plausible there maybe a delay in an international delivery going through Dublin, rather than London, but, I imagine An Post, Royal Mail and couriers are well used to it.

Also if you check out the new PON (GPS based postcodes) system that was recently launched in Ireland (very popular with couriers, by the way, because it's more accurate than regular UK style postcodes), Their GPS postcode system covers all counties on the Island of Ireland, i.e. the "domestic" counties include the six counties that make up the Northern Ireland region.

http://www.irishpostcodes.ie

It will take a few years for the new Irish postcode system to take hold and reach a point where everyone will know off the top of their head what their postcode is, so, the above list of counties is just a helper to make life easier for customers from the Island of Ireland on an ecommerce site....and for the commerce site to handle the order.

This: those six counties are

handelaar's picture

This:

those six counties are served by An Post [...] They have been for decades.

...is in direct logical opposition to this:

Do you honestly think that An Post would refuse to pass on an order to Royal Mail in Northern Ireland

As you correctly point out, An Post does not handle mail for the North. It sends that mail to the UK instead, and the process of mis-addressing adds several days to the delivery time.

IMHO by incorrectly pretending that this isn't so, you're encouraging something (at significant annoyance to potential customers, and possibly also at nonzero cost to customers) which should instead be actively discouraged.

If your issue is that these six counties don't appear in the UK autocomplete list, surely a more logical approch would be to patch the UK country file instead? In that case, we also don't start getting people bogged down in requiring or not-requiring postcodes incorrectly based on country of delivery.

I think the last thing we need is to inadvertently cause Drupal-based shops across the planet to mistakenly start shipping things to the wrong country entirely. I don't much care whether people should or shouldn't consider Ireland and Northern Ireland to be the same thing. The fact is that right now they bloody aren't, and pretending otherwise causes measurable harm to the app and to customers.

LOL

Dublin Drupaller's picture

The Irish postal company (An Post) sends parcels destined for Northern Ireland straight to the sorting office in Belfast, Handelaar. That's the same sorting office a parcel destined for NI would arrive at if it came through London.....

LOL

I would tend to look at this in an ecommerce/customer perspective.

Why? Because the customer is always right and given a choice, I would prefer not to offend a customer or stall an ecommerce order...hence the county list as presented.

The source of the patch was from experience with ecommerce sites servicing customers resident in those six counties and the issue isn't that the counties aren't listed in the UK autocomplete list (most of the major ecommerce sites, like Amazon, include Northern Ireland as a country now) the issue is that they aren't on the autocomplete list for Ireland - the way ecommerce works is that the county/state list is loaded based on the country selection. Not the other way around.

So it's impossible someone could choose the wrong country based on a county selection.

Thanks for outing yourself

handelaar's picture

Thanks for outing yourself as nothing but a noise troll by titling that comment "LOL", by the way. I'm less inclined to believe that this is somehow not politically-motivated when it's you, since this isn't the first time you've tried to incorrectly shoehorn the North into Ireland for no good reason. I think the last time was with location.module.

The Irish postal company (An Post) sends parcels destined for Northern Ireland straight to the sorting office in Belfast, Handelaar. That's the same sorting office a parcel destined for NI would arrive at if it came through London.....

The difference being that they won't get held up as misaddressed mail if they go trough London.

Your position seems to be that Drupal's official stance should be that we deliberately send parcels to the wrong country on the assumption that An Post will eventually send them up the road?

(most of the major ecommerce sites, like Amazon, include Northern Ireland as a country now) the issue is that they aren't on the autocomplete list for Ireland

Amazon has business logic which would interpret that user-entered data and correct it. You do not. Come up with patches which actually handle things like Amazon does -- namely, to require a postcode and append 'UK' to the label if an address is entered from NI -- and we're all fine.

But this is breakage.

wow

Dublin Drupaller's picture

I'm sorta sorry I brought up this topic. I really thought this sort of bickering was a thing of the past.

I'm not sure where exactly you're coming from handelaar.. but, if you're referring to Alan Burkes update to the location.module, I don't recall being involved in that discussion. Ironically, I notice you were.

You're also incorrect about Drupals official stance and deliberately sending parcels to the wrong country. Did you even read my thread discussion starter? I have permission to commit patches for the ecommerce modules, so if your absurd "politically motivated" theory was correct, wouldn't I have already comitted it, rather than open it up for sensible discussion?

The proposed patch for ecommerce was to include Ireland in the strore localisation.inc file for that module and the addition of the six counties was as a 'catch all' inclusion to cater for customers who prefer to use Ireland instead of the UK in their address. I can't believe you have a problem with that. I thought this sort of bickering was a thing of the past.

You're also incorrect about amazons ecommerce system logic. It doesn't correct user entered data. They patched their include files (they use Mason CMS, by the way) to include a seperate country to the UK called Northern Ireland in their country list.

If you have a problem with that as well, can I suggest you take it up with Amazon?

Having looked into it a little when creating the proposed patch for ecommerce, you might also want to get on to the people behind http://www.irishpostcodes.ie who have created a whole new set of GPS based postcodes for the Island of Ireland (including the 6 counties).

It is remarkable how accurate and efficient their postcode system is compared to the existing system for Northern Ireland. Check out this article about postcodes in northern ireland and compare their efficiency to those at http://www.irishpostcodes.ie

Mmm... I see your Problem

jon_stewart's picture

I've been musing over this for an Ubercart project.

UC doesn't have codes for Norn Irn in either UK or Eire. I think the logical solution is to add the six counties here with the UK country code. Irrespective of people's political aspirations for where the six counties up here belong, they are currently politically part of the UK, served by Royal Mail (not An Post, as correctly pointed out) and where the website has an integrated approach to order fulfillment, it seems a lot more likely that confusion is minimised by this approach.

One of the main 'quality of service' markers for us (well, actually, our customers) is that they get their deliveries next day (ideally), and not get shuffled between the different postal systems.

For reference, we sell both the NI and Eire, North America, Australia and NZ; we use either Royal Mail / Parcelforce, or An Post, depending on who is cheaper - it's great living next to the border. Anything going down south, I'll take to An Post, so it doesn't do a long detour to London and back (unless there has been a recent change to how foreign ;-) mail is handled!)

I also know that a proportion of our customers would be VERY offended by your solution, while clientele from down south couldn't care less (good on them - right attitude!).

Lastly, you can't be serious (McEnroe style and inflexion) about making up county codes for the six counties up here based on car registration plates that don't exist? ROFL!

EDIT: Credit card fulfillment for UK cards would require UK address format anyway.

I don't think you do..

Dublin Drupaller's picture

A few quick points.

While I'm saddened that you think your customers might be offended by something they would never see or even know about, I'm guessing you don't understand the purpose of the list.

Allow me to explain.

The counties list was based on observations from working with ecommerce solutions (mostly music). In other words, some customers in Derry, for example, preferred to address themselves as being in Northern Ireland, rather than the UK. Others addressed themselves as being in Great Britain and some addressed themselves as being in Ireland.

I'm not making up county codes for use on addresses. It's a code thing (the clue is in the thread title Irish county codes for forms and autocomplete functionality). The way ecommerce works (under the hood) with regions/countries/countries etc. is based on abbreviations, rather than full county names. IE translates into Ireland, for example. UK translates into the United Kingdom. In other words, the customer never sees the abbreviations....it's handled by the code. By populating the ecommerce code using the above abbreviations based on car regplates....the autocomplete functionality comes into play when checking out.

Consider a person in county armagh or county derry ordering a product online...if they are the type that might be offended by the notion of county codes for the Island of Ireland...they would probably use NORTHERN IRELAND or UNITED KINGDOM as their place of residence..and would therefore, never see the fact that they can choose Co. Armagh or Co. Derry in the list of counties.

Also....an post doesn't send letters addressed to Northern Ireland to London. I checked with them a long time ago. They sends send NI mail directly to the Belfast sorting office in the same way letters addressed to the Rest of Ireland don't go from belfast to london and then to Dublin.

As a tip...don't mention that to your customers. From the sounds of it...they might get offended that their mail was not sent directly to london for handling by non-irish people.

Incidentally..when I was talking to An Post about this a while back...they told me that an EU directive means that Ireland will have to have postcodes by the end of 2010 and it's likely that GPS postcodes will be introduced...probably based on this: http://www.irishpostcodes.ie/ which is an alphanumeric code system which is linked to GPS and very accurate....

Another option

alanburke's picture

Hi all,
For Ubercart, I simply created a Northern Ireland country file, so its there as another country in the dropdown list.

Look, no solution will make everybody happy.

Here's yet another proposal - let the site-builder make their choice.
Have the following countries as options
Ireland [32 counties]
Rep of Ireland [26 counties]
Northern Ireland [6 counties]
UK [not inc Northern Ireland]
UK & NI [inc Northern Ireland]

Obviously - some of these are mutually exclusive,

So for a site serving UK only - they can select that.
A site serving UK and NI - they've got that.
32 counties, Ireland - covered.
Want to treat NI as a separate entity - yep that can be done too.

In an ideal world, there would be a location API that handled all this on behalf of Ecommerce, Ubercart, whatver module needs location support.
That's not going to happen anytime soon...

Interesting

jon_stewart's picture

Thanks for putting me right on the mail transfer issue.

I don't 'think' some customers might be offended, I know they would, sad or not.

A couple of facts.

Great Britain is England, Scotland and Wales.
UK is Great Britain + Northern Ireland.

These are facts.

If somebody lives in Londonderry / Derry, they could use NI as country, or UK as country, or perhaps Eire / Republic of Ireland. Nobody in NI lives in Great Britain - different entity altogether. One question then is should you allow your customers to potentially confuse the situration by having Armagh in the Republic. Why not allow Armagh to appear in France? (I wish we were; the weather would be a whole lot better LOL!)

So, it's really a case of how you internally encode this for the application. I still think it's much simpler to do what Alan suggested and have a separate country file for NI (with or without the UK country code), but I would enforce the correct country for the appropriate county, as a means of ensuring clean workflow (of course I suppose there's nothing to stop someone coding a means of invisibly correcting those sorts of entries)

Got a question, might amuse you a little - What have Ireland, the Indian sub-continent, and Palestine got in common?

Anyway, I guess you do it whatever way works best for you. It's great to have a CMS with choice!

...

Dublin Drupaller's picture

If somebody lives in Londonderry / Derry, they could use NI as country, or UK as country, or perhaps Eire / Republic of Ireland. Nobody in NI lives in Great Britain - different entity altogether. One question then is should you allow your customers to potentially confuse the situration by having Armagh in the Republic.

Perhaps I'm not explaining correctly. Let me try again.

The autocomplete functionality (where the forms are filled out automatically as the customer types) is indexed by country, Jon.

In baby steps, that means, the customer chooses COUNTRY first....then they fill out the rest of the form.

If a customer chooses the UK, the UK postcodes array is loaded. THEY WON'T SEE THE LIST OF COUNTIES. If the customer chooses IRELAND, the Irish counties array is loaded. For auto complete purposes, the simplest option is to use the COUNTY CODES. Remember: the customer DOES NOT SEE THE COUNTY CODES....it's all in the PHP.

The CLUE is in the title of this thread, john. i.e. "Irish county codes for forms and autocomplete functionality". I added in the extra counties because of my observation that some people in the North of the Island of Ireland choose IRELAND instead of the UK as their country.

You're looking for a problem that isn't there, Jon.

Oh, I understand perfectly...

jon_stewart's picture

Which is why I suggested that one option is to internally fix the country / county combination after the form is submitted, so that you minimise the chance of confusion, depending on how backend order fulfillment is carried out.

As Allen said, why not add the six counties to both Ireland and UK, if you wish to stay politically neutral? Frankly I'm in agreement with handalaar here, that confusion, and thence delay in delivery of service / product should be minimised at source.

Did you figure out an answer to my question?

e-Commerce Module

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week