VAT rules and VAT types
This page is for business owners and accountants who need to know how the store calculates tax. It explains the two tools the shop has, fixed VAT types and VAT rules, and how the shop picks the rate for an order line. It describes what the software does, not what your tax law requires.
Warning
This page is not tax advice. VAT and sales tax law differ by country and change over time. The shop calculates what you configure; whether that is correct for your business is a question for your tax adviser (Products, prices and VAT).
Contents
- Two ways to charge VAT
- VAT types
- VAT rules
- How the shop picks a rule
- Where the customer's country comes from
- Sales tax outside VAT countries
- Checklist
Two ways to charge VAT
| Approach | How it works | Fits |
|---|---|---|
| Fixed VAT type on the price | Each price field names one VAT type, for example "Standard" | Stores that sell in one country, or charge the same rate everywhere |
| VAT rules | The price's VAT type is "Determined by VAT charging rules"; the rate comes from the customer's country and the product's category | Stores that sell to several countries, or have products with different rates |
The name of the dynamic VAT type is set in settings/shop.ini, [VATSettings] DynamicVatTypeName; the shipped value is
Determined by VAT charging rules.
VAT types
A VAT type is a named percentage, such as standard, reduced or zero. They are managed under Store > VAT types
(shop/vattype, which needs shop/setup). The class is eZVatType in kernel/classes/ezvattype.php.
- Name VAT types after what they mean to your accountant ("Standard 19", "Reduced 7", "Zero"), so nobody guesses.
- Change a percentage when the law changes; every price that uses the type follows.
- The Store dashboard warns when a 0 percent VAT type is in use, so a zero rate is never an accident (Store dashboard and order statuses).
VAT rules
A VAT rule says: for customers in this country, and products in these categories, use this VAT type. Rules are managed
in shop/vatrules and shop/editvatrule. Product categories are managed in shop/productcategories and assigned to
products through an ezproductcategory field.
Rules are applied by a VAT handler, and the shipped settings/shop.ini sets none: until
shop.ini [VATSettings] Handler=ezdefault is set in an override (settings/override/shop.ini.append.php), the rules
are stored and never read, and every product is charged the fixed VAT type on its price. The VAT rules page says
so when rules exist and no handler applies them. The handler is not switched on in the shipped file because doing so
changes checkout on a running store: the shop then needs the customer's country (with RequireUserCountry=true an
order without one is stopped), and the "Determined by VAT charging rules" type charges 0 percent where no rule matches.
The other settings connect rules to your content (shop.ini [VATSettings]):
| Setting | Meaning |
|---|---|
Handler | ezdefault for the shipped rules handler; shipped unset, so no rule is applied |
ProductCategoryAttribute | The identifier of the product field that holds the category |
UserCountryAttribute | The identifier of the user field that holds the customer's country |
RequireUserCountry | Shipped true: the shop must know the customer's country to apply rules |
A rule can name a specific country or apply to any country, and can name categories or apply to every category. A typical rule set for a store with standard and reduced rates:
| Country | Categories | VAT type |
|---|---|---|
| Any | Any | Standard |
| Any | Books | Reduced |
| A country where you are registered for VAT | Any | That country's standard rate |
These rows are an illustration of the mechanism, not a statement of any country's tax rates.
How the shop picks a rule
The default VAT handler (kernel/classes/vathandlers/ezdefaultvathandler.php) scores every rule against the order
line and takes the best match:
- A rule that names the customer's country exactly beats a rule for any country.
- A rule that names the product's category exactly beats a rule for any category.
- A rule must match both the country and the category to count at all.
- If several rules score the same, the first one wins.
In plain words: write one general rule for "any country, any category", then add specific rules only where the rate differs. The specific rule will win where it applies.
If the customer's country is not known, the handler uses a placeholder that matches only the "any country" rules (same file).
Where the customer's country comes from
The country comes from the customer's account field named in UserCountryAttribute, or from the country a visitor
chooses (shop/setusercountry). The country select in the shop forms is the grouped list described in
Country groups and regions; in VAT rules it posts the country code
(The grouped country list).
A different VAT logic, for example one based on the delivery address or on a customer's VAT number, can be written as
a VAT handler of your own; shop.ini [VATSettings] has RepositoryDirectories[] and ExtensionDirectories[] for it.
That is developer work (Writing a workflow event type
shows the general extension pattern; a partner can help, see Choosing a partner).
Sales tax outside VAT countries
The shop's terms are "VAT", but the mechanism is a percentage per country and category, so a store that charges sales tax can use the same tools. Tax that depends on a region inside a country, or that a tax service calculates at checkout, is not covered by the shipped handler and needs a custom VAT handler or an integration.
Checklist
- To do: Your tax adviser has confirmed the rates and where they apply.
- To do: VAT types are named after their meaning and percentage.
- To do: Prices use either a fixed VAT type or "Determined by VAT charging rules", consistently per class.
- To do: With rules:
Handler=ezdefaultis set in an override, and the VAT rules page shows no "not applied" notice. - To do: With rules:
ProductCategoryAttributeandUserCountryAttributeare set, and every product has a category. - To do: A general "any country, any category" rule exists.
- To do: Test orders from two countries and two categories show the expected VAT on the confirmation page.
- To do: The dashboard shows no unexpected 0 percent VAT type.
Related pages
- Products, prices and VAT
- Prices and currencies
- Country groups and regions
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.