What is Tax rule?
Magento Tax rules determine how tax will be applied on each order that are placed in the store.Tax rules in Magento is all the Tax elements in Magento put together,namely, customer tax class, product tax class, and tax rates.
How does Tax Rule work?
To set up a Tax rule, we have to define 3 tax element; customer tax class, product tax class and tax rate.
Depending on the customer (assigned a particular customer tax class) purchasing an item (assigned a particular product tax class) and the address (tax rate defined for a particular region, depending on the shipping address, billing address or shipping origin) Magento calculates the tax for each order.
It will be clearer when we do it with an example later in the article.
So for creating a Tax Rule we first have to create
1. Customer Tax class
2. Product Tax Class
3. Tax Rate
Adding a new Customer Tax Class:
1. From the Magento Admin panel, select Sales > Tax > Customer Tax Classes
2. Click on “Add New”.
3. Name it anything you like, for our example we will name it, Taxed Customer, and save it. We are done creating Customer Tax Class.
Adding a new Product Tax Class:
1. From the Magento Admin panel, select Sales > Tax > Product Tax Classes
2. Click on “Add New”.
3. Name it anything you like, let’s name it “Taxable Product” and save it.
Adding a Tax rate:
1. Select Sales > Tax > Manage Tax Zones & Rates.
2. Click on “Add New Tax Rate”.
3. Give “Tax identifier”, a name to identify this Tax rate. Lets’s name it “10% Tax”.
4. Select the Country for which you want to apply this Tax rate, we will keep it as United States.
5. Select the State if you want to apply this for a particular state, we will keep it as “*” which will make it applicable to all states.
6. Select whether this Tax rate will be applied over a range of Zip/Post code or some particular Zip/Post codes.
a. If you select it as “No”, then you can put the Zip/Post codes type in the next field. i.e. if you put “*”, then it will select all code, if you put “xyz*”, it will select all codes starting with “xyz” and not longer than 10.
b. If you select it as “Yes”, then you can put the Zip/Post code range in the next two fields. Give the Starting Zip/Post in the “Range From” field and the ending Zip/Post in the “Range To” field.
For this article we will keep the “Zip/Post is Range” field as ‘No’ and the “Zip/Post code” as “*”. And we will also give the “Rate Percent” as 10. You can give it any percent you like. And after that we will save the Tax Rate.
Creating the Tax Rule:
As we are done with creating the three required Tax elements, we will create the Tax Rule using those Tax elements.
1. From Admin go to Sales > Tax > Manage Tax Rules
2. Click on “Add new Tax Rule” button on top right.
3. Give a name to the Tax Rule, we will name it “US-10%-Tax”.
4. Select the Customer Tax Class that we created, i.e. Taxed Customer.
5. Select the Product Tax Class that we created, i.e. Taxable Products.
6. Select the Tax Rate, i.e. 10% Tax.
7. If you have multiple Tax Rules then you can give priority to them. In this case we will keep it as 0.
8. “Calculate off subtotal only” checkbox is used to override priority of Compound Taxes when you are applying multiple Taxes using priority.
We will keep this field unchecked.
9. Sort order is for positioning the Rule in the Tax Rules list.
10. After selecting all we will save the rule.
How will this Tax Rule get applied to my Order?
Assigning Customer Tax Class to customer:
For successfully applying this Rule to any order we have to assign the “Customer Tax Class” to a customer who will place the order. For that we have to apply it to the Customer group to which the customer belongs. Let’s be clearer about it.
Suppose I have a customer who is assigned to a particular Group, namely, General.
Now for applying the “Customer Tax Class” to this customer I have to assign the Customer Tax Class to the “General” customer group. For doing that we have to go to;
Customers > Customer Groups
Will click the “General” group for editing.
As you can see from the image that the Tax Class applied to the group is, “Retail Customer”, but we need to assign “Taxed Customer” and save it.
Now, we have assigned the Customer Tax Class to that particular customer. Remember, now any customer assigned to the “General” customer group will also have this “Customer Tax Class“ assigned to them.
Assigning Product Tax Class to Product:
For assigning the Product Tax Class to any product open up any existing product and click on the “Prices” tab on the side. At the bottom there is an option for choosing “Tax Class”. We will choose the one we created, i.e. “Taxable Products” and save the product. If you don’t have product created, you can create one and assign the Tax Class.
Check working of the Tax Rule:
Thus we are done with assigning the Customer and Product Tax classes, we can now place an order from the frontend to check whether our Tax is been properly applied or not.
We will open the frontend and will add the product on which we assigned the Product Tax Class. I have added it to “HTC Desire 501 Blue”.
Add the product to cart and proceed to checkout. In the checkout page we have to login with the customer data to whom we assigned the “Cuatomer Tax Class”. Remember that the address of the customer should match the region defined in “Tax Rate” defined earlier, which means, if the “Tax Rate” is defined for United States, the customer address should be that of United States.
In the image above we can see that a 10% tax has been applied in the order. So our Tax Rule is working correctly and now we can add more Tax Rules as per our requirement. Also, in Magento by default Tax is applied depending on the Shipping address and it can be changed in the Tax Configuration settings, which we will deal in a separate blog. So, this is all for now, let us know if there are queries from your side. Also if you have any request for any tutorial, leave a comment and we will come up with it soon. Have a wonderful day.