Shipping from Ireland EIRE to Ireland Northern – what a pain

By | October 17, 2012

I have a customer who owns a shop based in Eire where the postage cost to Northern Ireland (part of the UK) is substantially less expensive than post to the mainland UK. This presents quite a difficulty with getting shipping rates that are spot on, as the UK is England, Scotland, Wales and NI (there is no separated regions for shipping).

In effect, if Northern Ireland had it’s own ISO code things would be simple. To get around this, I set up my own “user defined” ISO code for Northern Ireland and added it to the countries list as “United Kingdom (NI)”. Downside of this approach is that the person creating the new account must select UKNI and not UK as their country. Not really a deal breaker, I think. So, now, the shopowner can separate NI from the UK quite easily, by using the new ISO code “QN” in the zones.php module.

The customer then also needs the ability to have the zones module work on order_total, not weight, and also the ability to insert % costs as well as $£ costs.

All in all, quite a straightforward project.

And then, a spanner in the works

I thought…what about already existing customers in NI, who (because they joined before the new fake UKNI country) still have shipping addresses linked to the UK. As soon as they log back in to order, they will get the more expensive UK shipping prices. Fortunately, there is a way around this also…all postcodes in Northern Ireland start with “BT”, so I need to come up with a piece of SQL to run in phpmyadmin that says; if (country == UK) and (first two letters of postcode == BT) update country to QN

That probably won’t make much sense as it is pseudo-code, all it does is transfer customers shipping addresses from the UK to UKNI, which means they get the proper shipping prices from this point forward.

Thinking Forward

This approach could also possibly be used for shipping to places such as Highlands and Islands, Channel Islands, IOM and so on. Just set up a fake ISO code for each and perhaps put a message on the create_account page to remind customers to choose their correct “country”…

Going back to the problem of the user selecting UKNI rather than UK, this can be accomplished using a line of javascript as we know that ALL postcodes in NI start with BT we can read that value from the postcode input box and update the country dropdown immediately. Video;

It would be very simple to also show a message or such to say we have “pre selected” the country to further aid the user.

Leave a Reply

Your email address will not be published.