Outline:
Return to Table of Contents
There are two forms of tax calculation available with the shopping system. Here is the data entry screen in the administration shop:
The simple tax calculation is based on one location and one percentage. The tax information for this method is entered directly into the administration shop and stored in the config.tag file.
The shopping system allows multiple tax calculations. To activate the more advanced tax calculations check the "Multiple" tax method radio button in the administration shop configuration. A special tax file called taxes.tdb is then created. This file must be in the shop mirror directory. This method will allow you to calculate taxes for multiple locations, calculate fixed rate for most customers with exemptions for particular categories, and to calculate tax by product type and country.
Creating and implementing the simple tax method involves providing values for a number of variables. These variables are populated through the administration shop and stored in the config.tag file. The basic variable fields for taxes as they appear in the config.tag file are:
&state-matches = "WA WAS WASH
WASHINGTON" ;
&tax-rate = "0.076" ;
&tax-shipping = "no" ;
&state-matches are a list of synonyms for the tax location. Matching is not case sensitive and none alphabetic symbols are ignored. For example:
WA WAS WASH WASHINGTON is adequate for a match to Washington state and will match any of these: Wa Wa. wa. wash WASH. Washington
&tax-rate is the rate to apply to the customer's purchases if his location matches the &state-matches variable.
&tax-shipping allows you to charge your customers tax on their shipping charges as well as their purchases.
Note: There is no taxes.tdb file when the simple method is used.
Tax regulations are complex and you may require more than one tax option for your customers. To enable multiple tax options, you must select "Multiple area tax method" in the administration shop and then create a taxes.tdb file to provide the tax specifications. The tax file must be a taxes.tdb file located in the mirror shop directory and the first two columns must be "method" and "rate". To review the general requirements for a *.tdb file see the database and data access section.
In addition to method and rate there are a number of other field names that are used to set up the taxes.tdb file. Here are the field names, and a definition for each field.
| Field Name | Definition and Use |
| method | The exact name of the tax as you wish it to appear in the customers cart. |
| rate | The tax rate. The rate should be presented as a decimal; that is, 8.2 % should be entered as .082. |
| match_fld | Designates the field name in the customer database that is used to check if a tax should be applied. In general this will be a state/province or country variable. The value is matched against the variables set for the shipping address. If a shipping address is not provided then the field matches against variables in the billing address. |
| match_values | A list of possible spellings of the locality. The match is not case sensitive. Localities containing multiple words, such as "West Virginia" or "United Kingdom", must be contained in quotes. |
| product_factor_fld | The field name in the product database that contains a multiplying factor. To suppress tax for an product place a "0" in the column in the product database. |
| cust_exempt_fld |