This project is not covered by Drupal’s security advisory policy.
July 2020 update: The Royal Mail has created a new zone for the US, world zone 3. If upgrading from beta-2 or earlier, it's recommended you check how you're using the module and confirm the change won't introduce any regressions.
The UK's Royal Mail categorises destinations as falling into five zones across the world: the UK, Europe, and world zones 1, 2 and 3. The Royal Mail zones module makes it easy to check which zone a country's in.
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:
- 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.
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.
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_world_zone_3($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
- world zone 3
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.
module_load_include('inc', 'rmzone');
rmzone_countries_uk();
rmzone_countries_europe();
rmzone_countries_world_zone_1();
rmzone_countries_world_zone_2();
rmzone_countries_world_zone_3();
Project information
- Minimally maintained
Maintainers monitor issues, but fast responses are not guaranteed. - Maintenance fixes only
Considered feature-complete by its maintainers. - Module categories: E-commerce, Automation
- 23 sites report using this module
- Created by AndyF on , updated
- This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Move US to the new world zone 3
Development version: 7.x-1.x-dev updated 20 Jul 2022 at 09:19 UTC