Herzlich willkommen

Shipping tax

Magento assigns a fixed tax class to shipping. However, if a cart contains products with different tax rates (e.g. standard and reduced), the correct shipping tax rate is not unambiguous. This extension calculates the shipping tax class dynamically based on the cart contents. The fields are located under Stores → Configuration → (Sales) EU VAT Enhanced → Versand-Umsatzsteuer-Einstellungen.

Dynamic shipping tax class
Shipping VAT settings

Choosing the algorithm

Use dynamic shipping tax class (use_dynamic_shipping_calculation, default: No) offers the following methods:

Value Option Effect in brief
0 No No dynamic calculation (Magento default).
1 Use the tax class with the largest sum Shipping follows the class with the largest net line sum.
2 Use the tax class with the highest rate Shipping follows the highest rate present in the cart.
3 Use proportional calculation based on product values Shipping is split proportionally across the rates by product value.
4 Use the tax class with the highest quantity Shipping follows the class with the highest quantity.

Additional tax classes

For methods 1–4 you assign the reduced product and shipping tax classes (visible only when a method is active):

  • Reduced product tax class (reduced_product_class)
  • Reduced shipping tax class (reduced_shipping_class)
  • Super reduced product tax class (super_reduced_product_class) – optional
  • Super reduced shipping tax class (super_reduced_shipping_class) – optional

Methods 1, 2 and 4 select one product tax class and map it onto the corresponding shipping tax class: reduced product class → reduced shipping class, super-reduced → super-reduced, everything else → standard shipping class. The entire shipping is then taxed at this single rate. Only the proportional method (3) mixes several rates on the shipping line.

Default tax classes
The default tax class must be the one for the standard / highest rate

The four methods in detail

All examples are based on the same cart (German shop, standard rate 19%, reduced rate 7%):

Item Tax class Net unit price Quantity Line sum
Book reduced (7%) €20.00 5 €100.00
Device standard (19%) €50.00 1 €50.00
Shipping €5.90 net

Bundle items are skipped by all methods. If the evaluation results in an exact tie (methods 1 and 4), the Magento default shipping tax class is retained.

1 · Largest sum

Rule: for each product tax class the net line sums are added up; the class with the largest sum determines the shipping tax class.

Example: reduced = €100.00 versus standard = €50.00. The largest sum is the reduced class → shipping receives the reduced shipping tax class (7%).

Shipping tax = €5.90 × 7% = €0.41   (entire shipping at 7%)

2 · Highest rate

Rule: if the cart contains at least one item of the standard class, shipping receives the standard shipping tax class. Otherwise the reduced one (if present), else the super-reduced one. The class category is decisive (standard > reduced > super-reduced), not the numeric rate – which is why the standard class must be the highest rate.

Example: the device (standard 19%) is present → shipping receives the standard shipping tax class (19%), regardless of the sum or quantity of the other items.

Shipping tax = €5.90 × 19% = €1.12

If the cart consisted only of books (reduced), shipping would be at 7%.

3 · Proportional

Rule: the only method that mixes several rates on the shipping line. The shipping amount is split proportionally by the net value share of each tax class; each share is taxed at its own rate.

Example: net values: reduced €100.00, standard €50.00, total €150.00.

Reduced share:   €5.90 × 100/150 = €3.93  →  7%  →  €0.28
Standard share:  €5.90 ×  50/150 = €1.97  → 19%  →  €0.37
─────────────────────────────────────────────────────────────
Total shipping tax                          =          €0.65

The total shipping tax is thus simply the sum of the individual shares (€0.28 + €0.37 = €0.65). No averaged blended rate is formed – each value share of the shipping is taxed at its own rate (7% or 19%) and reported separately in the tax summary.

4 · Highest quantity

Rule: for each product tax class the quantities are added up; the class with the highest total quantity determines the shipping tax class.

Example: quantities: reduced = 5 units versus standard = 1 unit. The highest quantity is the reduced class → shipping receives the reduced shipping tax class (7%).

Shipping tax = €5.90 × 7% = €0.41

Unlike "Largest sum", quantity counts here – a single expensive standard item is outvoted by many cheap reduced items.

Comparison on the same cart

Method Decision in the example Shipping rate Shipping tax on €5.90
Largest sum reduced (€100 > €50) 7% €0.41
Highest rate standard item present 19% €1.12
Highest quantity reduced (5 > 1 units) 7% €0.41
Proportional value share €100 / €50 7% + 19% €0.65

"Largest sum" and "Highest quantity" yield the same result here because the reduced items dominate both by value and by quantity. They diverge as soon as the highest-value class is not also the highest-quantity class (e.g. a single expensive standard product next to a few cheap reduced items).

The proportional calculation is the most accurate variant, but also the one most in need of explanation. Which method is correct in your case should be agreed with your tax advisor.