Magento Taxes Tutorial

How to set up and manage taxes in Magento

Magento has options that allow you to set up a complex system of taxation. You can define product tax classes and assign them to products, set up customer tax classes and associate customer groups with a particular tax class, you can set up the percent of the tax depending on the region/state and country of the customer (it can be based on the shipping or billing address, or on the shipping origin). Tax rules combine all these aspects to determine the actual tax based on the products in the cart (and the tax class assigned to these products), the customer group to which the customer belongs and the billing/shipping address of the customer. You can also apply more than one tax rule in the cases when compound taxation is required.

In this tutorial we'll examine the process of setting up the different tax classes and tax rates, and bringing them together into tax rules. There's also a tutorial in which are discussed the system tax settings in Magento.

Product Tax Classes

Each product can have a product tax associated with it. To add and manage product tax classes go to Sales menu>Tax>Product Tax Classes in your Magento admin panel. On the page that opens you'll see a table with the existing product tax classes. If your Magento is without sample data, by default there should be two preconfigured classes: Shipping and Taxable Goods. If you installed sample data, there will be an additional one called default. To edit a class click on its name in the table; to add a new one click on the Add New button above the top right corner of the table:

Adding and Editing Product Tax Classes

On the add/edit page you can specify the name of the product tax class:

Product Tax Class Settings

Don't forget to click on the Save Class button in the upper right corner.

A product tax class can be assigned to a product when you add/edit a product. When you go to Catalog>Manage Products and you add/edit a product, select the Prices tab on the left and use the Tax Class drop-down menu to select the product tax class:

Assigning a Product Tax Class to a Product

Of course, if you don't want the particular product to be taxed you can select None.

Customer Tax Classes

Magento also has options to define customer tax classes. Each customer on your site belongs to a customer group. Each customer group in itself has a customer tax class associated with it. You can use this, for example, to differentiate between wholesale and retail customers. To add and edit customer tax classes go to Sales menu>Tax>Customer Tax Classes in your admin panel. On the page that is displayed there's a table with the existing customer tax classes. Magento (both with and without sample data) comes preconfigured with a class called Retail Customer. To edit an existing class click on its row in the table and to add a new one click on the Add New button in the top right corner:

Adding and Editing Customer Tax Classes

On the add/edit page you can set or change the name of the customer tax class:

Customer Tax Class Settings

Don't forget to click on the Save Class button.

To associate a customer tax class with a customer group go to Customers menu>Customer Groups, click on the name of the group that you want to edit and on the following page select the class from the Tax Class drop-down menu:

Assigning a Customer Tax Class to a Customer Group

If you need more information on customers and customer groups check out the tutorial on managing customers in Magento.

Managing Tax Zones and Rates

The next step is to set the geographical zones and the tax rates associated with each zone. The zone can be a whole country or it can be a region/state/province within a country. To do this in your admin panel go to Sales menu>Tax>Manage Tax Zones & Rates. On the page that opens you'll see a table with the existing zones. Magento comes preconfigured with a couple of example tax zones. To edit an existing zone click on its name in the table and to add a new one click on the Add New Tax Rate button:

Adding and Editing Tax Zones and Rates

On the add/edit page there are several options:

Tax Zone and Rate Settings

Let's go over them:

  • Tax Identifier - in this field you can specify the name of the tax which you can use to identify it. Use a name without spaces (you can separate words with hyphens or underscores). This name is mainly for internal use, but if you don't specify a name for the tax rate for each store view (this is done in the Tax Titles section on the same page), then the tax identifier will be displayed to users. You can have many tax rates per zone so you can use the tax identifier to distinguish between rates for the same zone, as well as for different zones.

  • Country - use this drop-down menu to select the country for which the tax rate will apply.

  • State - you can use this drop-down menu to select a state/province within the selected country. Magento comes preconfigured with the states/provinces of many of the countries (especially those that have different tax rate per state/province). By default, the drop-down is set to an asterisk (*) which means that the tax rate will apply to all states/provinces within the country.

  • Zip/Post is Range - this can be set to No or Yes. By default, it's set to No. In this case the Zip/Post Code option is displayed under it. The value in that field is set to * (wildcard) by default which means that the tax rate will be applied with any zip/post code specified by the customer. You can limit the match if you put some numbers plus an asterisk/wildcard; for example, 934* will match any code that begins with 934. Another way to limit the zip/post codes to which the tax rate will be applied is to set the Zip/Post is Range drop-down menu to Yes. In this case two fields will appear: Range From and Range To. You can use them to specify the exact range of zip/post codes that will be matched.

  • Rate Percent - in this field you can type the numbers of the actual percent of the tax rate.

On the same page there's also a section labeled Tax Titles. It lists all store views that you've created. There's a text field for each store view. In that field you can type the title of the tax as it will appear in that particular view on the frontend. If you don't specify a title, the tax identifier will be used.

After you're done with the settings don't forget to click on the Save Rate button.

Managing Tax Rules

Tax rules are used to combine product tax classes, customer tax classes and tax rates. Without setting up tax rules taxes will not be applied at all. Using tax rules you can set up a more or less complex system of taxation, whatever is required for your store. To add and manage tax rules go to Sales menu>Tax>Manage Tax Rules in the admin panel of your Magento. On the page that opens there's a table with the existing tax rules. There should be one or two example tax rules (depending on whether you've installed Magento with sample data). To edit a tax rule click on its row in the table; to add a new one click on the Add New Tax Rule button in the top right corner:

Adding and Editing Tax Rules

On the page with the tax rule settings there are several options:

Tax Rule Settings

Let's go over them:

  • Name - type whatever name you want for the tax rule. Something that will make it easy for you to know what the rule includes.

  • Customer Tax Class - this option is a list of all the customer tax classes that you have created. You can select one or many customer tax classes from the list. The tax rule will apply if the customer belongs to a customer group that's associated with one of the selected customer tax classes. To mark/unmark more than one tax class press and hold the Ctrl button on your keyboard and click with the left mouse button on the name of the tax class in the list.

  • Product Tax Class - this is a list of all the product tax classes that you've created. If the product(s) that the customer puts in the cart are assigned to one of the selected product tax classes in the tax rule, then they will be taxed. You can select one or more product tax classes. To do this press and hold the Ctrl button on your keyboard and select the tax class(es) with the left mouse button.

  • Tax Rate - this option is a list of the tax rates that you've added. To mark/unmark more than one rate press and hold the Ctrl button on your keyboard and click on the rate(s) with the left mouse button. If the address of the customer matches one of the selected zones/rates in this list, then the tax rule will be applied.

  • Priority - this option enables you to determine when the tax should be applied in relation to other tax rules. For example, if there are two tax rules that match all the conditions, both will be applied. The one with a lower number for priority will be applied first (e.g. a rule that has 0 for priority will be applied before another one that's set to 1). This is useful for setting up complex tax systems. For example, some countries have a general tax and some provinces/states in that country have an additional tax that's applied after the general country tax is applied.

  • Sort Order - you can use this option to set the order in which the tax rules should be displayed.

As we mentioned, in order for a tax rule to be applied all conditions have to be met. So the ordered product should be associated with a product tax class that's selected from the respective tax rule option. The customer should belong to a customer group whose associated customer tax class is marked in the Customer Tax Class list of the tax rule. The customer's address should match one of the tax rates selected for the tax rule. When all these match Magento automatically calculates the tax based on all the options.

In this tutorial we described how to set up taxes. There are, however, some additional system options related to tax. These include, for example, all the tax display settings, whether the tax should be based on the customer's billing or shipping address, etc. For more information read the tutorial on managing the system tax settings in Magento.

You may also find useful the tutorial on adding fixed product taxes in Magento and the one on exporting and importing tax rates in Magento.