DJ XO montage

So, what’s in Royal Mail World Zone 1?

And more to the point, how the hell do you get a list suitable for populating your online shop with shipping prices?

I sat on the Royal Mail site for more than half an hour today trying to find such a list and there simply is none. They have catered well for the case where you want to send a package and know where it’s going, but don’t seem to care about people who need to price stuff to anywhere. Google was not much help either!

I did come across this international shipping country world zone PDF - but what I needed were country codes in ISO format for CubeCart (that is, “GB” not “Great Britain”, “ES” not “Spain”, anyway you get the idea). And I’m most certainly not spending 4 hours guessing ISO codes and retyping them! No chance!! I’d rather spend 4 hours spreading bad publicity about Royal Mail’s complete and total failure to be of any help.

Anyway, In the end I found this: Big Royal Mail plugin for Zen Cart. Ok so all the definitions of what’s what are buried in the PHP code, but at least it’s in a useful format…!

Whoa is me. If only this was the USA: the USPS apparently has a web service API where you can just query prices from your software. Muuuch easier…

So, how do you get the Royal Mail International Zones and Prices into CubeCart?

1) Download Big Royal Mail plugin for Zen Cart and open the zip file

2) browse to includes/modules/shipping (yes it’s all burried away!)

3) open the file rmamsmallpacket.php in Notepad (I assume rmamsmallpacket is supposed to mean Royal Mail Air Mail Small Packet, which were the prices I wanted. You might need another file for a different set of prices).

4) about 3/4 of the way down the file, you will see some comma separated lists deep within a whole bunch of code. For example, “AL, AD, AM, AT, AZ, BA, BE, BG, BY, CY, CZ, …” (that’s the beginning of the Europe list). This is the list of ISO country codes that Cubecart wants! - and in the same format cubecart takes it, too! - although you will have to get rid of the spaces. So, open a 2nd copy of Notepad, and paste these in.

5) Search and replace all the spaces into nothings. CubeCart is agoraphobic.

6) Scroll down a little further and you will find a whole bunch of comma separated weight/price pairs which look like this: “0.1:1.19, 0.12:1.31, 0.14:1.44, …”. You will find about 5 of these for Europe. Copy and paste these into notepad one after the other and de-space-ify them as well. This is the list of PRICES that CubeCart wants!

7) Do steps 4 through 6 again for the World Zone 1 and 2 codes and prices.

Irritating Conclusion

Now… it’s very interesting to me that this Zen Cart plugin has the prices in essentially the same format as CubeCart’s plugin BUT THAT THEY’RE NOT IDENTICAL. What this tells me is that one of two things is true…

Either: a) the guy who wrote CubeCart’s plugin based it on Zen Cart’s. But if that’s true, why is there no reference to Zen Cart’s - or where to source the data - anywhere in the plugin? And why would he change the format?
Or: b) Both Cube Cart and Zen Cart’s plugins took their data from an officially provided source, such as a Royal Mail SDK. If there is such a thing, I can find no mention of it on their website, which is 99.5% developer-irrelevant. Google was almost no help at all. Why are they making it so difficult??


 

5 Responses to “So, what’s in Royal Mail World Zone 1?”

  1. raretv Says:

    Just a quick helping hand for everyone - here are rthe zone lists (no prices as they change them all the time). Note: I left the spaces in so it wraps nicely! :)

    UK
    GB

    Europe
    AL, AD, AM, AT, AZ, BA, BE, BG, BY, CY, CZ, DE, DK, EE, ES, FI, FO, FR, GI, GL, GR, HU, HR, IS, IE, IT, KZ, LI, LT, LU, LV, MK, MT, PL, PT, SE, SI, SK, SM, RU, UZ, UA, TM, TR, TJ, CH, MD, MC

    Rest of World
    AX, AF, DZ, AS, AO, AQ, AI, AG, AR, AW, AU, BS, BH, BD, BB, BZ, BJ, BM, BT, BO, BW, BV, BR, IO, BN, BF, BI, KH, CM, CA, CV, KY, CF, TD, CB, CL, CN, CX, CC, CO, KM, CG, CK, CR, CI, CU, DJ, DM, DO, TP, EC, EG, SV, GQ, ER, ET, FK, FJ, FX, GF, PF, TF, GA, GM, GE, GH, GI, GD, GP, GU, GT, GN, GW, GY, HT, HM, HN, HK, IN, ID, IR, IQ, IL, JM, JP, JO, KE, KI, KP, KR, CS, KW, KG, LA, LB, LS, LR, LY, MO, MG, MW, MY, MV, ML, MH, MQ, MR, MU, YT, MX, FM, MN, CS, MS, MA, MZ, MM, NA, NR, NP, NL, AN, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PA, PG, PY, PE, PH, PN, PR, QA, RE, IE, RO, RW, KN, LC, VC, WS, ST, SA, SN, CS, SC, CL, SG, SB, SO, ZA, GS, ES, LK, SH, PM, SD, SR, SJ, SZ, CH, SY, TW, TH, TG, TK, TO, TT, TN, TC, TV, UG, AE, US, UM, UY, VU, VA, VE, VN, VG, VI, WF, EH, YE, YU, ZR, ZM, ZW

    Big thank you for your post, saved me a ton of time…

  2. Parthiv Says:

    Hi . I want source code in Asp.net….if can help me out..

    thanks & regards,

  3. Ben XO Says:

    Hi there,

    I’m sorry - there’s no source code here. This is a blog post about Royal Mail postal zones.

  4. Dave Haygarth Says:

    This is brilliant - thanks! and thanks to raretv for coming up with the list!

  5. Mark Obscene Says:

    crikey, you get bloody everywhere mr XO. just what i was looking for, cheers!

Leave a Reply