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.
There are two Rule conditions provided:
- Country is in Royal Mail zone: This takes the country and zone as text inputs.
- 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.
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.
The following function returns the zone of the given country, where the zone is one of:
- world zone 1
- world zone 2
The following funtions all return an array with matching key value pairs of country codes.