Posted on

Magento 1.4.0.1 Tax Calculation error – Out by a factor of 100

I was just setting up a store with GST tax on Magento 1.4.0.1 and got caught up on a bug where the tax on a product would be calculated correctly, but the total on the cart page would show it 100x (yes 100 times!) lower than it actually was, leading to an incorrect total being calculated for when tax is included.

With a bit of Google’ing and I found this forum post which had the answer. A clean way of making this little patch while we await a core fix is:

mkdir -p app/code/local/Mage/Tax/Model/Sales/Total/Quote/
cp app/code/core/Mage/Tax/Model/Sales/Total/Quote/Tax.php app/code/local/Mage/Tax/Model/Sales/Total/Quote/
vi app/code/local/Mage/Tax/Model/Sales/Total/Quote/Tax.php

and make the change on line 314:

        $rate = $rate/100;

to:

        // Removed bug with tax calculation
        //$rate = $rate/100;

That should fix it, let me know how you get on.

One thought on “Magento 1.4.0.1 Tax Calculation error – Out by a factor of 100

  1. wow, thanks alot! this helped

    i just had a tax of 0,01€ .. now its working well, good job

    i dont know what happened with the path there, but i found this tax.php here:

    /app/code/core/Mage/Tax/Model/Sales/Total/Quote

Comments are closed.