{"id":796,"date":"2014-12-06T23:11:48","date_gmt":"2014-12-06T23:11:48","guid":{"rendered":"http:\/\/blog.amberspyglass.co.uk\/?p=796"},"modified":"2014-12-07T01:03:49","modified_gmt":"2014-12-07T01:03:49","slug":"ireland-and-northern-ireland","status":"publish","type":"post","link":"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/","title":{"rendered":"Ireland and Northern Ireland"},"content":{"rendered":"<p>I fixed Ireland and Northern Ireland!<\/p>\n<p>Well. I mean I fixed the shipping calculator in the store. Ireland was a typo I made\u00a0in 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).<\/p>\n<p>Northern Ireland was trickier. The third-party API our store uses to calculate shipping\u00a0requires 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&#8217;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 <em>not<\/em> optional for Northern Ireland: it <em>had<\/em> to be &#8216;NIR&#8217; (not blank, and <em>not<\/em> one of the district codes). Three lines of PHP later, it works!<\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-796\" class=\"share-twitter sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-796\" class=\"share-facebook sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span>Email<\/span><\/a><\/li><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>More<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\"><span>Tumblr<\/span><\/a><\/li><li class=\"share-pinterest\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-796\" class=\"share-pinterest sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\"><span>Pinterest<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-796\" class=\"share-linkedin sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span>LinkedIn<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-pocket\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-pocket sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li class=\"share-print\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-print sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/\" target=\"_blank\" title=\"Click to print\"><span>Print<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>I fixed Ireland and Northern Ireland! Well. I mean I fixed the shipping calculator in the store. Ireland was a typo I made\u00a0in the list of countries UPS and other couriers could ship to; in effect, it was not in &hellip; <a href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n<div class=\"sharedaddy sd-sharing-enabled\"><div class=\"robots-nocontent sd-block sd-social sd-social-text sd-sharing\"><h3 class=\"sd-title\">Share this:<\/h3><div class=\"sd-content\"><ul><li class=\"share-twitter\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-twitter-796\" class=\"share-twitter sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=twitter\" target=\"_blank\" title=\"Click to share on Twitter\"><span>Twitter<\/span><\/a><\/li><li class=\"share-facebook\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-facebook-796\" class=\"share-facebook sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=facebook\" target=\"_blank\" title=\"Click to share on Facebook\"><span>Facebook<\/span><\/a><\/li><li class=\"share-email\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-email sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=email\" target=\"_blank\" title=\"Click to email this to a friend\"><span>Email<\/span><\/a><\/li><li><a href=\"#\" class=\"sharing-anchor sd-button share-more\"><span>More<\/span><\/a><\/li><li class=\"share-end\"><\/li><\/ul><div class=\"sharing-hidden\"><div class=\"inner\" style=\"display: none;\"><ul><li class=\"share-tumblr\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-tumblr sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=tumblr\" target=\"_blank\" title=\"Click to share on Tumblr\"><span>Tumblr<\/span><\/a><\/li><li class=\"share-pinterest\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-pinterest-796\" class=\"share-pinterest sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=pinterest\" target=\"_blank\" title=\"Click to share on Pinterest\"><span>Pinterest<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-linkedin\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"sharing-linkedin-796\" class=\"share-linkedin sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=linkedin\" target=\"_blank\" title=\"Click to share on LinkedIn\"><span>LinkedIn<\/span><\/a><\/li><li class=\"share-reddit\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-reddit sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=reddit\" target=\"_blank\" title=\"Click to share on Reddit\"><span>Reddit<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-pocket\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-pocket sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/?share=pocket\" target=\"_blank\" title=\"Click to share on Pocket\"><span>Pocket<\/span><\/a><\/li><li class=\"share-print\"><a rel=\"nofollow noopener noreferrer\" data-shared=\"\" class=\"share-print sd-button no-icon\" href=\"https:\/\/amberspyglass.co.uk\/blog\/2014\/12\/06\/ireland-and-northern-ireland\/\" target=\"_blank\" title=\"Click to print\"><span>Print<\/span><\/a><\/li><li class=\"share-end\"><\/li><li class=\"share-end\"><\/li><\/ul><\/div><\/div><\/div><\/div><\/div>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[3],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p3ebGx-cQ","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/posts\/796"}],"collection":[{"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=796"}],"version-history":[{"count":1,"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/posts\/796\/revisions"}],"predecessor-version":[{"id":797,"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/posts\/796\/revisions\/797"}],"wp:attachment":[{"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=796"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=796"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amberspyglass.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=796"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}