The heart of a shop is the shopping cart. A comprehensible and correct calculation of the sums, positions and taxes is essential in order not to disturb the confidence of the customers in the shop. For this reason, this article should once clarify the calculation basis of the shopping cart and give you opportunities to check the calculation yourself. In addition to numerous basic functions of shopware such as price groups, discounts and surcharges, shipping costs, vouchers and promotions, there are of course also countless plugins that take part in the calculation of the shopping cart. Therefore it is important that you also get an idea of which extensions may influence the calculation and what effects this may have.
In Germany there are two valid methods for calculating VAT. The vertical and the horizontal method. Shopware uses the vertical method, where the tax is calculated at item level, rounded and finally added together. In contrast, the horizontal method first calculates the sum of the VAT contained in all products and then rounds it. The use of the vertical method enables the tax contained in each item to be shown on the /checkout/confirm page. This is not possible with the horizontal procedure.
Shopware also shows two decimal places at all points of the frontend. So that your customers can always follow the calculation, the value rounded to 2 digits is always used.
Definition:
VAT is calculated individually for each line item – that is, item price × quantity, then the tax is calculated and rounded per item. At the end, all tax amounts are summed.
Typical Behavior:
Tax is calculated separately for each line item
Rounding occurs at the item level
Especially relevant when multiple quantities of the same item or many individual items are involved
Example:
| Item | Net Price | VAT (19%) | Gross Price |
|---|---|---|---|
| Product A | €1.99 | €0.38 | €2.37 |
| Product B | €2.99 | €0.57 | €3.56 |
| Product C | €3.99 | €0.76 | €4.75 |
| Total | €8.97 | €1.71 | €10.68 |
In this example, tax is calculated individually for each item (e.g., Product A: €1.99 × 19% = €0.38 VAT). At the end, all separately calculated taxes are added together.
Definition:
VAT is calculated only after summing all net amounts. Then the tax is applied to the total net amount and rounded once.
Typical Behavior:
Tax calculation is done at the total level
Rounding occurs only once at the end
Ideal for even amounts or invoices based on total values
Example:
| Item | Net Price | VAT (19%) | Gross Price |
|---|---|---|---|
| Product A | €1.99 | ||
| Product B | €2.99 | ||
| Product C | €3.99 | ||
| Total | €8.97 | €1.70 | €10.67 |
In this example, no tax is calculated per item. Instead, VAT is calculated based on the total net amount: €8.97 × 19% = €1.70 VAT.
Compared to horizontal tax calculation, there's a rounding difference of €0.01.
In the vertical calculation, the net total per tax rate is determined for the entire invoice and the VAT total is calculated from this. In the horizontal calculation, the VAT is calculated for each individual item line, taking into account the respective tax rate. Both methods of calculation are legally allowed, but can lead to rounding differences in the case of decimal places.
Shopware does not have a central place for calculating the shopping basket. The calculations in the front- and backend are basically separated from each other. Therefore, you should always follow the complete path in your shop if you suspect an error here. Best you proceed as follows, if a customer contacts you:
If a problem is confirmed here, you should first check whether one of the plugins used interferes with the calculation of the shopping cart. For this you can use the security mode or set up a test shop that does not use any plugins.