StudioForty9 | Search Engine Marketing, E-Commerce, Web Design, Web Development, Magento, ExpressionEngine

  • Home
  • Products
  • Our Work
  • Our Team
  • Blog
  • Contact Us

An Irish Module for Magento

Just in time for St. Patrick's Day!

  • Date 9th March, 2011
  • Author Alan Morkan
  • Category General

I had been meaning to write a small "Ireland" module for Magento for a while but only got around to it last week.

It has 2 pieces of functionality:

  1. It adds the counties of Ireland (including Northern Ireland), into the 'directory_country_region' table of the Magento database so the list of Irish counties appears when you change the country to Ireland on any of the forms in Magento (checkout, cart, etc.)
  2. It adds a shipping method for An Post, the national postal carrier of Ireland.

There's nothing much to say about part 1, but there's a few points I'd like to mention about part 2:

  • The code is based on WebShopApps MatrixRate module (http://www.magentocommerce.com/magento-connect/webshopapps/extension/604/webshopapps-matrixrate--the-original-multiple-table-rate-solution--certified-bug-free). It's a really great module and would recommend it for anyone who needs to use tablerates as their shipping method.
  •  The main advantage of this module is that it provided partial postcode matching out of the box. So it was easy to setup an "all--Ireland" rate since all Northern Ireland postcodes start with "BT". Just give all "GBR" shipping destinations with postcode starting with "BT" the same cost as the Irish rate.
  •  The next issue, which I've come across a number of times, is the concept of an EU rate and a non-EU European rate. Rather than having to put in the same rates 27 times to account for each EU country, and another 10 or 20 times for the non-EU countries, I decided to custom code things. I put the value of "EUR" and "!EU" into the database to denote EU and non-EU respectively. When retrieving rates, I check to see if the country code (e.g., 'DE' for Germany) is in an array which contains all the country codes for EU and non-EU countries respectively. If so, I return the EU/non-EU shipping rate. 5-10 lines of code saving thousands of lines in the database/CSV.
  •  Matrixrate is based on importing a CSV with the desired rates. So first I created a CSV for all the different zones (Ireland, UK, EU, Non-EU, Rest of the World) with all the different shipping options An Post offers (Standard Post, Registered Post, Express Post, Courier Post) and imported that. I then made a backup of the resulting database table and put the SQL for this table into the installer script for the module.
  •  Finally, I should point out that An Post has different rates based on what type of package is being sent (Envelope, Large Envelope, Packet, Package). Envelope and Large Envelope are ignored in this module. There is an assumption that Packets are used for the lightest shipments, and Packages are used thereafter. I think this is a reasonable assumption - take a look at the An Post rates on their website here - http://www.anpost.ie/AnPost/PostalRates/Standard+Post.htm


Anyway, if you're interested in using the module, you can find it here: http://www.magentocommerce.com/magento-connect/SF9/extension/5980/sf9_anpost

Subscribe to Our Blog
Recent Posts Toggle
  • An Irish Module for Magento
  • Taking Control of Product Options in Magento
  • jQuery in Magento made easy
  • Restricting Product Purchase to Authorised Users in Magento
  • West Cork Homeless
  • Fota Wildlife wins Best Tourism & Travel Website… and also takes the Eircom Spiders Grand Prix
  • Realex Redirect with PHP
  • Blinds & Magento
  • Fota Wildlife shortlisted for Golden Spider Award
  • Curtains & Magento
Categories Toggle
  • Expression Engine (2)
  • General (6)
  • Magento (7)
  • PHP (1)
  • Portfolio (2)
  • Realex (1)
  • SEO (1)
  • We are now getting twice as many hits as we were in the past and the numbers are growing by the week. StudioForty9 are innovative, well organised, knowledgeable, flexible and very easy to deal with.
    Stephen RyanFotawildlife.ie
  • I have been working closely with StudioForty9 for over a year now. They are a key part of my online strategy and I can recommend them without hesitation.
    Brendan O'SullivanMyBlinds.ie
  • I have no hesitation in recommending StudioForty9. I now regard them as critical partners in my business.
    Fred CroweSpeech-Writers.com
  • As a business development consultant I understand what it takes to build and expand a business and when it comes to the online business sector, this company has what it takes to deliver.
    Billy O'ConnorThe Discovery Partnership

MyMailCampaign Client Login StudioForty9 Lite

Copyright © 2006 - 2012 StudioForty9. 2nd Floor, 34 Grand Parade, Cork City, Ireland. Phone: +353 87 225 1250