this bug is driving me nuts and I do not know how to fix it.

The following scenario:

We have sample articles. Each has a cost without tax of 0.30 €

German VAT is 19% usually. Now I put 4 samples into the cart. 3 of them get a price of 0.36 €, 1 gets 0.35 € (see screenshot)prices with tax

My calculation settings are:

  • Catalog Prices: Excluding tax (This sets whether catalog prices entered from Magento Admin include tax) --> Our prices are set without tax
  • Tax Calculation Method Based On = Total (even if I change this to row or subtotal, nothing changes)

The prices seem 1:1 as the output when I inspect the elements.

See here: enter image description here

And here: enter image description here

But as said, the calculation is wrong. Either all products here should have a price of 0.36 € or all should have 0.35 € but not mixed up.

Does anybody out there have an idea, how I can fix this so that prices for the same product have the same price incl. tax?

  • 1
    if the error is gone when you change VAT to 16%, you have at least several months left to fix it :) however, can you check the database: Magento uses 4 decimals for prices. is it possible that the 3 products are at 0.3000, while the 1 product is at 0.2950 ? Amount added to cart is 1 each? Commented Aug 3, 2020 at 11:19
  • Hi. Thank you for the hint. Where in the database would I look this up? And do you know possibly, why the database creates two different prices here for the same products? In our live shop of course we have changed all to 16% ;) This is the test environment and no matter if 5% or 20%, issue remains the same.
    – Ben
    Commented Aug 3, 2020 at 13:32
  • 1
    prices are stored in catalog_product_entity_decimal, simply filter for your product's entity_id. The database wouldn't create a different price here, but maybe someone entered it wrong, or you have some automations in place that calculates price on the fly when they are entered or displayed. You might also want to check quote_item and see how the prices look there for products in the cart. Commented Aug 3, 2020 at 13:38
  • Hi, we have checked the table [catalog_product_entity_decimal] has the price for the products as 0.300000. The we have checked the [quote_item] table and there it says base tax either as 0.5000 or 0.6000. So somewhere inbetween this weird calculation must happen. Neither changing to calculation based on Unit price, Row Total or Total changes this behavior :(
    – Ben
    Commented Aug 3, 2020 at 15:45
  • Ok, I would then start by disabling custom modules one after the other, and re-test again. It may also help to identify the issue when you create a new product with the same attributes as the one that doesn't work, and test that. Commented Aug 3, 2020 at 15:49

2 Answers 2


I can't reproduce your issue so I don't know if this helps or note but here is my setup :)

enter image description here

  • Hi @Joao71 - I have changed the setting but the same problem occurs
    – Ben
    Commented Aug 3, 2020 at 15:40
  • Hummm, it seems to me that there is some sort of configuration error in one of your sample products price/tax settings. Could you check if this happens when you add 4 instances of the same sample product to the cart?
    – Joao71
    Commented Aug 3, 2020 at 15:46
  • The weird thing is that it happens randomly. If I put 4 samples in the cart, the 3rd sample always has 0.35 € and the others 0.36 €. If I then delete this article with 0.35 € and put in another one, it changes again. Do you maybe now, how possibly it can happen that the tax setting is not working maybe? Or do you have any other clue maybe? Thanks in advance.
    – Ben
    Commented Aug 3, 2020 at 15:50
  • Ok. I am officially stupid. What happend was, that the setting was changed in Default Config as well as in Main Website. So changing the setting to the correct Scope helped.
    – Ben
    Commented Aug 5, 2020 at 6:14
  • Ahahah, it has happened to me a load of times in the past, to the point I had a post it reminder on my desk :)
    – Joao71
    Commented Aug 5, 2020 at 8:06

take a look https://github.com/magento/magento2/issues/18025

this is known magento issue


for me this helped: Tax Calculation Method Based - On Unit.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.