Configuration‎ > ‎CSV Configuration‎ > ‎

Postcode Filtering

 

 

Overview


In some circumstances it may be necessary to filter rates based on the postcode or zipcode a customer is in. Our extensions support 3 different methods for filtering based on zipcode. The method you choose depends on your country location and postcode format in place:
  1. Range based filtering - with this you specify zipcode ranges e.g. 6000-8000,9000-1000 to match on
  2. UK based filtering - this was specifically developed for the UK market and allows you to specify the start of the postcode e.g. PA25, E1, etc
  3. Canada based filtering - sepecifically developed for the Canadian market and allows you to specify the start of the postcode e.g. A0A.
  4. Pattern based filtering - Where the above 2 methods are not appropriate you can use pattern matched filtering. We havent found a country that doesnt support this!
Please note: UK based filtering is not supported in the free Matrix Rates extension. It is supported in all paid extensions, and we strongly recommend customers upgrade to the Premium Matrix Rate if they are having to filter based on postcodes; otherwise their CSV file will be large and difficult to maintain.
 

Range based Zipcodes


 
This approach is most commonly used in Australia and the USA. It is not suitable for use in the UK.
 
You can specify a range of zipcodes to match on. For example if you put a range from 3000 to 4000 and a quote hits on 3500 it will match on this row. This includes 4000 and 3000 and anything in between.
 

The following example shows usage when “Use Zip code Range to/From” is set to “Yes” :

(Please note that COUNTRY is required for this to work)


Country

Region/State

City

Zip From

Zip To

Weight From

Weight To

Shipping Price

Delivery Type

AUS

*


*


0

20

15.00

Main Post

AUS

*

*

9766

9856

0

20

15.99

Main Post

AUS

*

*

9766

9856

0

20

9.50

Aus Courier1

AUS

*

*

9857

9899

0

29

12.20

Aus Courier 2

*

*

*

*

*

0

10

50

Worldwide



Using this file above here are some scenarios with rates that would be shown :

Input Criteria

Output Rates

Aus buyer, zipcode 9770, total item weight of 3

9.50 – Aus Courier1

Aus buyer, zipcode 9878, total item weight of 3

12.50 – Aus Courier1

Aus buyer, zipcode 3000, weight 3

15.00 – Main Post

French buyer, total weight of 3

50.00 – Worldwide


 
 

UK based Postcodes

Use UK based filtering if working on UK postcodes.
 
The filtering works by looking at the first part of a postcode. Let's take the following examples:
 
SS9 4JQ
E1 4RT
PA25 4ER
PA25ER
 
The extension is intelligent enough to see that these postcodes need to match on SS9, E1, PA25 and PA2 respectively.
 
When in the UK we recommend you use UK postcode filtering if available. This feature is not supported in the free Matrix Rate extension, we strongly recommend you purchase the Premium version if you are doing postcode filtering in the UK.
 
An example of the format for filtering is shown here as used in Product Matrix.
Note: In Shipping Method configuration there is a setting to 'Use UK Postcode filtering'. This must be set to Yes. Use Zip code range must be set to No. If it is not then you will not see the results you desire. 
 
UK postcodes do not work with ranges.



WC postcodes - these are a special set of postcodes in London

They must be entered into your CSV in the following manner WC1A, WC1B etc...


Canada based Postcodes

Use Canada based filtering if working on Canadian postcodes.

The filtering works by looking at the first part of a postcode. Let's take the following examples:

A0A 1L0
B2R1A8
A5A 5TY

The extension is intelligent enough to see that these postcodes need to match on A0A, B2R and A5A respectively.

When in Canada we recommend you use Canada postcode filtering if available. This feature is not supported in the free Matrix Rate extension, we strongly recommend you purchase the Premium version if you are doing postcode filtering in the UK.

Canada postcodes do not work with ranges.

 

All other types of Postcodes


The extension supports MySQL Pattern matching to allow for other types of post/zip code formats.  This method is also the only one supported by the free Matrix Rate extension for UK based customers.
 
There are 2 special characters:
  1. underscore '_' which matches any alphanumeric
  2. percent '%' which matches anything after

To match all post/zip codes beginning with a a sequence. I.e. to match any postcode beginning with 902 you would enter 902%.

This is very powerful but doesn't fit all requirements, such as if you need to use UK postcodes and treat the postcode EH12 2JK differently from EH1 2LD as entering just EH12% would potentially match both if no space is present. This can be solved by creating rules using "_" which represents one and only one character of any type. So you would create a rule such as such:

  • EH12 ___ for the EH12 postcode entered with a space
  • EH12___ for the EH12 postcode entered with no space
  • EH1 ___ for the EH1 postcode entered with a space
  • EH1___ for the EH1 postcode entered with no space
 

Example

 

PO1___ would match all postcodes starting with PO1 followed by 3 chars

PO1 ___ would match all postcodes starting with PO1 followed by space followed by 3 chars

BT% would match all Northern Island Postcodes

PO14% would match all postcodes starting with PO14


This example shows usage when "Use Zip code Range To/From" is set to "No" and you are just pattern matching :


Country

Region/State

City

Zip From

Zip To

Weight From

Weight To

Shipping Price

Delivery Type

GBR

*


*


0

5

2.99

1st Class Recorded

GBR

*


*


0

31.99

5.99

Parcelforce 24-48

GBR

*


*


32

1000

80

Special Pallet Delivery

GBR

*

LONDON

*


0

5

7.99

Parcelforce 24-48

GBR

*

LEEDS

*


0

32

9.99

Parcelforce 24-48

GBR

*


*


2000

2100

0

Collection only

GBR

*


BT%


0

5

11.99

1st Class Recorded

GBR

*


BT%


0

32

14.99

Parcelforce 24-48

GBR

*


PO1 ___


0

5

8.99

Parcelforce 24-48

GBR

*


PO1___


0

32

8.99

Parcelforce 24-48

GBR

*


PO14 ___


0

5

6.99

Parcelforce 24-48

GBR

*


PO14___


0

32

6.99

Parcelforce 24-48

IRL

*


*


0

32

17.99

Parcelforce 24-48

*

*


*


0

10

50

Worldwide


Using the file above here are some scenarios with rates that would be shown :

Input Criteria

Output Rates

GBR buyer, not from London, or with postcode

starting BT, PO1, total item weight of 3

2.99 - 1st Class Recorded

5.99 - ParcelForce 24-48

GBR buyer, postcode starts with BT, weight of 3

11.99 - 1st Class Recorded

14.99 - ParcelForce 24-48

GBR buyer, weight 50

80.00 – Special Pallet Delivery

Ireland buyer, weight 15

17.99 – Irish Courier

French buyer, total weight of 3

50.00 – Worldwide

French buyer, total weight of 15

No options would be displayed

English buyer, total weight of 2040

0 - Collection only

GBR buyer, postcode entered as PO1 xxx or

PO1xxx, weight 5

8.99 - ParcelForce 24-48

GBR buyer, postcode entered as PO14 xxx or

PO14xxx, weight 5

6.99 - ParcelForce 24-48


 
Comments