US Zip Codes
Permalink Browser Info Environment
First, some examples of setting up zones based on the first digit of US zip codes.
Address to Zone Map:
Country - equal to - United States - DomesticUSA
Postal Code - begins with - 7 - DomesticZip7
Postal Code - begins with - 6 - DomesticZip6
Postal Code - begins with - 3|4 - DomesticZip3or4
Country - equal to - United Kingdom|Spain|France|Germany|Sweden|Norway......etc - Europe
Country - default - anything - RestofWorld
Address to Zone Map (alternate way of doing it that is longer but equivalent):
Country - equal to - United States - DomesticUSA
Postal Code - begins with - 7 - DomesticZip7
Postal Code - begins with - 6 - DomesticZip6
Postal Code - begins with - 3 - DomesticZip3or4
Postal Code - begins with - 4 - DomesticZip3or4
Country - equal to - United Kingdom - Europe
Country - equal to - Spain - Europe
Country - equal to - France - Europe
Country - equal to - Germany - Europe
Country - equal to - Sweden - Europe
Country - equal to - Norway - Europe ......etc more rules for Europe
Country - default - anything - RestofWorld
Address to Zone Map:
Country - equal to - United States - DomesticUSA
Postal Code - begins with - 7 - DomesticZip7
Postal Code - begins with - 6 - DomesticZip6
Postal Code - begins with - 3|4 - DomesticZip3or4
Country - equal to - United Kingdom|Spain|France|Germany|Sweden|Norway......etc - Europe
Country - default - anything - RestofWorld
Address to Zone Map (alternate way of doing it that is longer but equivalent):
Country - equal to - United States - DomesticUSA
Postal Code - begins with - 7 - DomesticZip7
Postal Code - begins with - 6 - DomesticZip6
Postal Code - begins with - 3 - DomesticZip3or4
Postal Code - begins with - 4 - DomesticZip3or4
Country - equal to - United Kingdom - Europe
Country - equal to - Spain - Europe
Country - equal to - France - Europe
Country - equal to - Germany - Europe
Country - equal to - Sweden - Europe
Country - equal to - Norway - Europe ......etc more rules for Europe
Country - default - anything - RestofWorld
Type: | Discussion |
---|---|
Status: | Archived |
EDIT - THE NUMBER/RANGE MATCHING IS NOW STANDARD WITH ZBS.
(from ZBS version 1.5)
To make life easier I have put together a number matching option with a replacement for the file /packages/jl_zonebased_shipping/libraries/zbs_rule_matching.php
This new 'number range' match is beta code.
I won't make this a formal update yet as I want the current version of ZBS to settle down first, Its only fair to existing users who don't need to be updating every few days.
With this enhancement can then do
Country - equal to - United States - Domestic USA
Postal code - number range - 13000-29499|80000-88599 - SpecialZipZone
If you want to try this beta code, please PM me an email address and I will send the file.
(from ZBS version 1.5)
To make life easier I have put together a number matching option with a replacement for the file /packages/jl_zonebased_shipping/libraries/zbs_rule_matching.php
This new 'number range' match is beta code.
I won't make this a formal update yet as I want the current version of ZBS to settle down first, Its only fair to existing users who don't need to be updating every few days.
With this enhancement can then do
Country - equal to - United States - Domestic USA
Postal code - number range - 13000-29499|80000-88599 - SpecialZipZone
If you want to try this beta code, please PM me an email address and I will send the file.
Is this standard now in 1.7 version?
Thanks!
Thanks!
Yes, and with the latest version you can also have single numbers in a list of ranges.
eg:
10000-11000|90500-90600|90621|90677
eg:
10000-11000|90500-90600|90621|90677
For those needing to match more complex ranges of zip codes, the shortest current (v1.5) ZBS way is to use a regex match
eg
map the following zip codes to a single zone.
13000-29499
80000-88599
Can be done with a series of separate regexes (specific details not tested):
Country - equal to - United States - Domestic USA
Postal Code - regex - ^1[3-9]{1}[0-9]{3}$ - SpecialZipZone
Postal Code - regex - ^2[0-8]{1}[0-9]{3}$ - SpecialZipZone
Postal Code - regex - ^29[0-4]{1}[0-9]{2}$ - SpecialZipZone
Postal Code - regex - ^8[0-7]{1}[0-9]{3}$ - SpecialZipZone
Postal Code - regex - ^88[0-5]{1}[0-9]{2}$ - SpecialZipZone