Filtering Based on State

Rule Explanation

You can optionally filter your rates based on state/region that the customer is in. For example you might want to offer different rates to Alaska than you do for the rest of USA.  This filter allows you to do that.

You must use the region/state codes within Magento in your csv file.  In the USA these match the standard state codes (e.g. CA, AK, HI, NY). Elsewhere you should be aware of the codes as you have probably used in your tax setup


This field can be left with a * which means include all.

Best Match Filtering

As the extension works based on the best match if it finds a set of rules that match for the state then it will stop searching.

Multiple States on One Line

With all the paid WebShopApps extensions you can put any combination of multiple states on one line. This feature is not supported in the free Matrixrates extension.

Examples where this is useful:

  • Specify exemption rates for Alaska, Hawaii e.g. AK, HI

Advanced Details

Finding out the region codes used

For most of our customers you can skip this section and look at examples.

If you look in directory_country_region you will get the full list of region/state codes used.  If you want to say remove some of the military states then you can do by modifying this table.

Firstly check you have regions – these can be seen in the drop down on the cart shipping estimator.  If you don’t then try downloading your countries locale extension. Otherwise you may need to define yourself (if you wish to use).

If you have region codes you need to use the short code in the CSV. This correlates to the code field in the database table directory_country_region.

The values in the region/ state field (from csv) are converted into numeric values before they are saved in the extension shipping table within the database. For example:
  • If there is no value in region filed, it gets save as zero
  • If there is value say NSW or any region in that filed, then it will convert the value into its numeric value and saves into the database and when you try to retrieve it, then it gets converted back to the actual value
Armed Forces State Codes

Armed Forces state codes were condensed from AF, AA, AC, AE, AM and AP to AA, AE and AP in Magento CE 1.8/EE 1.13.

This was a core Magento code change that also affected Table Rates, whereby some Armed Forces states would not filter correctly because of the duplicate “AE” state code.

Patch SUPEE-4805 resolves for Table Rates. Premium Rates 7.7.5 and Product Matrix 19.24 address this code change.

State Old State Code New State Code
Armed Forces Africa AF AE
Armed Forces Americas AA AA
Armed Forces Canada AC AE
Armed Forces Europe AE AE
Armed Forces Middle East AM AE
Armed Forces Pacific AP AP


0 votes

Leave a Reply

Featuring WPMU Bloglist Widget by YD WordPress Developer