Ireland and Northern Ireland

I fixed Ireland and Northern Ireland!

Well. I mean I fixed the shipping calculator in the store. Ireland was a typo I made in the list of countries UPS and other couriers could ship to; in effect, it was not in that list, so only small orders could be shipped there, by Royal Mail (up to 2 kg, and no longer than 60 cm).

Northern Ireland was trickier. The third-party API our store uses to calculate shipping requires the addresses in a specific format, which includes a field for the ISO 3166-2 country subdivision code (e.g. US state, Canadian province etc). It’s optional, because there already is a field for state/province/county/land/canton/district/department/oblast/etc, so the plugin never populated it. After some playing with the API, and noticing an offhand comment in the documentation, I learned that the ISO 3166-2 code was not optional for Northern Ireland: it had to be ‘NIR’ (not blank, and not one of the district codes). Three lines of PHP later, it works!

Leave a Reply