Magento 2 Experten — Hyvä Theme, Tailwind CSS & SEO aus einer Hand ›

Tax Classes and Tax Rules

01 Kapitel 1 von 4

How product, customer and shipping tax classes combine into a tax rule, and how to sensibly preset your default classes.

Magento's tax calculation rests on three building blocks that only produce an actual tax rate once combined: a tax class for the product, a tax class for the customer, and a tax rate for a geographic zone. A tax rule under Stores > Taxes > Tax Rules ties all three together into an actual calculation instruction.

Product tax classes

Every product carries the Tax Class attribute in the pricing area of the product edit form. Out of the box, Magento ships with "Taxable Goods" and "None". Create your own classes (e.g. a "Reduced Rate" class for books or groceries in Germany) under Stores > Settings > Tax Rules, or directly from the product form via the small "+" link next to the dropdown – handy if your catalog mixes 19% and 7% items.

Customer tax classes

Similarly, every customer group (see the "Customer Groups" chapter) carries a Customer Tax Class, usually "Retail Customer". For B2B stores this is the lever that lets you automatically move business customers into a tax-exempt class once their VAT ID has been validated (see the next subchapter).

Assembling tax rules

A tax rule combines one or more product tax classes, one or more customer tax classes and one or more previously created tax rates (see the next subchapter) into a named rule with a priority and a calculation order. Priority controls whether multiple simultaneously matching rules are added together or calculated in a cascading fashion (relevant for combined state and municipal taxes in the US, for example – for the standard German case, a single rule with priority 0 is enough).

Default classes save time

Under Stores > Configuration > Sales > Tax, group Tax Classes, you set which class gets assigned automatically to new products and shipping line items. This saves you from manually setting the tax class on every single new product – a real time saver once your catalog passes a hundred items.

 TaxClasses

Practical tip: keep the number of tax classes low. Every additional product/customer class combination multiplies the number of rules you have to maintain – for most German stores, two product classes (standard 19%, reduced 7%) plus one or two customer classes (retail, tax-exempt B2B) are enough.