Matrixrates: Destination Filtering

The first 5 columns in the CSV file are used to define the destination filtering. Using this it’s possible to set different rates for Hawaii and Utah, London and the Shetlands, Perth or Sydney, to name just a few.

Destination filtering can include a combination of one or more of country, state, city, or zip code.

All our shipping extensions work on a “best match” basis. It will try to match on all the address initially; if rates are found it will stop searching, if not then it will reduce the search criteria and search again.

The search will attempt to match the entered destination as follows:

  1. Country, State, City, Zipcode
  2. Country, State, City
  3. Country, State, Zipcode
  4. Country, State
  5. Country
  6. Worldwide (* in country)

Once a match is found it will stop searching.

Example of Best Match in Practice

The shipping rules are:

  • $10 Ground Shipping to US lower 48
  • $20 Next Day Shipping to all of USA
  • $15 Ground Shipping to Alaska, Hawaii

The solution for this would be to replicate our shipping options, as seen below:

Destination Filtering (Correct)

By comparison, the CSV below would not work:

Destination Filtering (Incorrect)

If you try out the bottom CSV, directly above, you will see that if you specify a zip code from Alaska (AK) or Hawaii (HI) the option for “Ground ” only will be displayed – the “Next Day” option will be missing. The extension will only match on the line that specifies Alaska/Hawaii, not the one with the asterisk. This is the “best match”.

Explanation

Our shipping extensions work on a “best match” basis. It will try to match on all the address initially; if rates are found it will stop searching, if not then it will reduce the search criteria and search again.

An asterisk within the destination conditions means “everything else”. Because we have specified that AK and HI have their own “Ground” delivery type, this affects all of the other rows.

For example, in the first four rows of the top CSV, as AK and HI have already been specified, AK and HI will not be matched on the rows with asterisks (*), therefore we also have to specify that AK and HI have a “Next Day” delivery type.

Further Reading

Filtering based on state/region code

Filtering based on postcode/ZIP code

Example CSVs

Was this doc helpful?