|
|
Want to know more about Packt's Article Network? Interested in contributing your article ideas? Please visit our FAQ for more information. See More BROWSE
All Titles WordPress Web Services SOA BPEL Web Graphics & Video Web Development RAW Portugues, Espanol, Italiano, French PHP/MySQL Oracle Open Source Networking & Telephony Moodle Microsoft & .NET Linux Servers jQuery Joomla! JBoss Java e-Learning e-Commerce Dynamics Drupal CRM Cookbook Content Management Beginner Guides Architecture and Analysis AJAX Future Titles Recently Published Titles In this article by William Rice, we will learn about Categories, Products, and Attributes in Magento. The combination of products, presentation, and service makes our store unique. In this part, we will see how to add products to our store. Before adding products, we need to make some decisions about how we will organize our site. A few minutes of planning now can save us hours of work later. See More |
Creating Tax Rules in Magento
Anatomy of a Tax RuleA Tax Rule is a combination of the tax rate, shipping address, product class, customer class, and amount of purchase. A Tax Rule states that you pay this amount of tax if you are this class of purchaser, and you bought this class of product for this amount, and are shipping it to this place. The components of a Tax Rule are shown in the following screenshot. This screen is found under Sales | Tax | Manage Tax Rules | Add New Tax Rule.
You will see the Name of the Tax Rule while working in the backend. Customer Tax ClassCustomer Tax Class is a type of customer that is making a purchase. Before creating a Tax Rule, you will need to have at least one Customer Tax Class. Magento provides you with a Tax Rule called Retail Customer. If you serve different types of customers—retail, business, and nonprofit—you will need to create different Customer Tax Classes. Product Tax ClassProduct Tax Class is a type of Product that is being purchased. When you create a Product, you will assign a Product Tax Class to that Product. Magento comes with two Product Tax Classes:Taxable Goods and Shipping. The class Shipping is applied to shipping charges because some places charge sales tax on shipping. If your customer's sales tax is different for different types of Products, then you will need to create a Product Tax Class for each type of Product. Tax RateTax Rate is a combination of place, or tax zone, and percentage. A zone can be a country, state, or zip code. Each zone that you specify can have up to five sales tax percentages. For example, in the default installation of Magento, there is one tax rate for the zone New York. This is 8.3750 percent, and applies to retail customers. The following window can be found at Sales | Tax | Manage Tax Zones & Rates and then clicking on US-NY-*-Rate 1:
So in the screenshot of our Tax Rule, the Tax Rate US-NY-*-Rate 1 doesn't mean "a sales tax of 1 percent." It means "Tax rate number 1 for New York, which is 8.3750 percent." In this scenario, New York charges 8.3750 percent sales tax on retail sales. If New York does not charge sales tax for wholesale customers, and you sell to wholesale customers, then you will need to create another Tax Rate for New York:
Whenever a zone has different sales taxes for different types of products or customers, you will need to create different Tax Rates for that zone. PriorityIf several Tax Rules try to apply several Tax Rates at the same time, how should Magento handle them? Should it add them all together? Or, should it apply one rate, calculate the total, and then apply the second rate to that total? That is, should Magento add them or compound them? For example, suppose you sell a product in Philadelphia, Pennsylvania. Further suppose that according to the Tax Rule for Pennsylvania, the sales tax for that item is 6 percent, and that the Tax Rule for Philadelphia adds another 1 percent. In this case, you want Magento to add the two sales taxes. So, you would give the two Tax Rates the same Priority. By contrast, Tax Rates that belong to Tax Rules with different Priorities are compounded. The Tax Rate with the higher Priority (the lower number) is applied, and the next higher Priority is applied to that total, and so on. Sort OrderSort Order determines the Tax Rules' position in the list of Tax Rules. Why create Tax Rules now?Why create a Tax Rule now, before adding our first Product? When you add a Product to your store, you put that Product into a Category, assign an Attribute Set, and select a Tax Class for that Product. By default, Magento comes with two Product Tax Classes and one Tax Rule already created. The Product Tax Classes are Taxable Goods and Shipping. The Tax Rule is Retail Customer-Taxable Goods-Rate 1. If you sell anything other than taxable goods, or sell to anyone other than retail customers, you will need to create a new Tax Rule to cover that situation. Creating a Tax RuleThe process for creating a Tax Rule is:
Each of these steps is covered in the subsections that follow. Time for action: Creating a Customer Tax Class
What just happened?A Tax Rule is composed of a Customer Class, Product Class, Tax Rate, and the location of the purchaser. You have just created the first part of that formula: the Customer Class. Time for action: Creating a Product Tax Class
What just happened?A Tax Rule is composed of a Customer Class, Product Class, Tax Rate, and the location of the purchaser. You have just created the second part of that formula: the Product Class. Creating Tax RatesIn Magento, you can create Tax Rates one at a time. You can also import Tax Rates in bulk. Each method is covered in the next section. Time for action: Creating a Tax Rate in Magento
What just happened?A Tax Rule is composed of a Customer Class, Product Class, Tax Rate, and the location of the purchaser. You have just created the third part of that formula: the Tax Rate. The Tax Rate included the location and the percentage of tax. You created the Tax Rate by manually entering the information into the system, which is suitable if you don't have too many Tax Rates to type. Time for action: Exporting and importing Tax RatesIn my demo store, I have created a Tax Rate for the state of Pennsylvania. The Tax Rate for the city of Philadelphia is different. However, Magento doesn't enable me to choose a separate Tax Rate based on the city. So I must create a Tax Rate for each zip code in the city of Philadelphia. At this time there are 84 zip codes, and are shown here:
I don't want to manually create each of these Tax Rates in Magento. It would be much faster if I create them in a spreadsheet program, and import the file into Magento. The process will be like this:
Magento: Beginner's Guide
Exporting Tax Rates
Adding the new Tax Rates and/or editing the existing ones
Finally, use Fill | Down to copy this formula into the other 83 rows. Checking the file in a text editor and converting it to a UNIX formatWhen using a text file, Magento may display an error reading Invalid file format upload attempt, your text file is probably saved in a Windows or Macintosh, text-only format. Even though text-only files look the same on Windows, Mac, and UNIX (Linux), they are not. Before Magento can read the file, you need to convert the file to the UNIX format We need to use a text editor designed to work with Windows/Mac/UNIX formats. On Windows, try the free program TedNPad. On Mac, try TextWrangler. Now, let's convert it to a UNIX format:
"Code","Country","State","Zip/Post Code","Rate","default" Notice that each item of data is enclosed in double quotes. Also, notice that each taxrate has four decimal places
Notice that I've named the file TaxRates.txt. The filename extension really doesn't matter, as long as the file is text-only, saved in the UNIX format, and follows the format that we saw. Importing the file and checking that Magento has updated the Tax Rates
What just happened?A Tax Rule is composed of a Customer Class, Product Class, Tax Rate, and the location of the purchaser. We have just created the third part of that formula: the Tax Rates. Each Tax Rate included the location and the percentage of tax. We created these Tax Rates by exporting a template from Magento. We opened this template in Excel, entered the tax rates, and saved it as a text file. Finally, we imported the Tax Rates back into Magento. Time for action: Creating a Tax RuleFinally, after creating the Customer Tax Classes, Product Tax Classes, and Tax Rates/Zones that we need, we are ready to create Tax Rules. For our demo store, we will need only one Tax Rule. Retail customers who purchase non-food items within Pennsylvania (including Philadelphia) pay sales tax. All other purchases are tax-free, so we don't need any Tax Rules to cover them.
Notice that all of the Customer Tax Classes, Product Tax Classes, and Tax Rates/Zones that you created are displayed here. The Tax Rule will be a combination of these three elements. You can choose one or more of each element.
What just happened?A Tax Rule is composed of a Customer Class, Product Class, Tax Rate, and the location of the purchaser. You have just combined these elements into a Tax Rule. This Rule will apply to the unique combination of customer/product/location. SummaryIn this article, we saw how a Tax Rule combines the zone/rate, product type, and purchaser type into a Rule that determines the tax on a product. We created these components first, and then combined them into a Rule. Magento: Beginner's Guide
About the AuthorWilliam Rice William Rice is a software training professional who lives, works, and plays in New York City. His indoor hobbies include writing books and spending way too much time reading sites like slashdot and 43folders. His outdoor hobbies include orienteering, rock climbing, and edible wild plants (a book on that is coming someday). William is fascinated by the relationship between technology and society: how we create our tools, and how our tools in turn shape us. He is married to an incredible woman who encourages his writing pursuits, and has two amazing sons. For more updates on him and his work, you could visit his online blog: http://williamriceinc.blogspot.com. Books from Packt
|
TOP TITLES ![]()
|
| ||||||||