Download & Extend

Royal Mail zones

The UK's Royal Mail categorises destinations as falling into four zones across the world: the UK, Europe, world zone 1, and world zone 2. The Royal Mail zones module makes it easy to check which zone a country's in. Note that by this definition the UK isn't in Europe, which might seem counter-intuitive at first.

This module doesn't

  • integrate with any Royal Mail APIs (if there are any);
  • provide Royal Mail shipping pricing rules.

Rules

There are two Rule conditions provided:

  1. Country is in Royal Mail zone: This takes the country and zone as text inputs.
  2. Order address is in Royal Mail zone: This takes the country, a Commerce Order, and the address you're interested in (eg. shipping). Requires Commerce.

API

All countries are specified as two letter ISO 3166-1 alpha-2 country codes (eg. GB). The following test functions all accept a country code and return a boolean value.

<?php
module_load_include
('inc', 'rmzone');
rmzone_country_in_uk($country);
rmzone_country_in_europe($country);
rmzone_country_in_world_zone_1($country);
rmzone_country_in_world_zone_2($country);
rmzone_country_in_zone($country, $zone);
?>

The following function returns the zone of the given country, where the zone is one of:

  • uk
  • europe
  • world zone 1
  • world zone 2

<?php
module_load_include
('inc', 'rmzone');
rmzone_country_get_zone($country);
?>

The following funtions all return an array with matching key value pairs of country codes.

<?php
module_load_include
('inc', 'rmzone');
rmzone_countries_uk();
rmzone_countries_europe();
rmzone_countries_world_zone_1();
rmzone_countries_world_zone_2();
?>

Downloads

Version Downloads Date Links
7.x-1.0-beta2 tar.gz (10.65 KB) | zip (11.89 KB) 2013-Jan-31 Notes

Project Information


Maintainers for Royal Mail zones

  • AndyF - 1 commit
    last: 41 weeks ago, first: 41 weeks ago

Issues for Royal Mail zones

To avoid duplicates, please search before submitting a new issue.
All issues
Bug reports
Statistics (2 years)
New issues
Open bugs
Participants