0

I'm running a Magento 1.9.0.1 build with the 'Tax Calculation Method Based On' setting set to Total but running into the issue of tax and total prices coming out at 1 pence less than it should be. I wondered if someone could help with figuring how to correct this. I have already changed all of the default rounding and precision in various files from 2 to 4.

As an example, Placing an order for 79 of a product with a Unit Price of £2.46 (Ex Tax) the Total (Ex Tax) price is correctly coming out at £194.34. However, the Tax line is coming out at £38.86 and Magento is rounding this from £38.868.

My client would prefer this rounded to £38.87 - since this is how the HMRC and Sage Accounts round these figures. The Order Total would then be £194.34 (Ex Tax) + £38.87 (Tax) = £233.21 (Inc Tax).

Because Magento is currently placing the tax at £38.86 (1p out), the Order Total is also 1p out at £233.20 instead of £233.21 from what Sage Accounts calculates.

This would place a Unit Price inclusive of tax of £2.952 instead of £2.95 (which is also how Sage Accounts would handle this).

We still need the site to display the price as £2.95 in this instance but the customer would need to be charged £233.21 instead of the £233.20 that Magento is currently displaying.

Thank you.

1 Answer 1

0

Sorry to hear that you got caught in Magento's age-old issue.

Firstly, check your admin configuration settings are similar to this official link

If this does not resolve the issue, you need to gracefully override the Mage_Core_Model_Store class and change the following method to :

public function roundPrice($price)
{
   return round($price, 4);
}

Remember, this might cause rounding issue on PayPal, but I have not come across any issue with PayPal or AmazonPay after the override.

2
  • Hi there. Thank you. Our settings do indeed match those in the screenshots at the link provided and I did modify the Mage_Core_Model_Store class in the core file. This is currently set to 3 but I have tried this set to 4 and the result was the same. :( May 21, 2017 at 17:52
  • The similar case I have come across in one store with configurable product where most products are showing correct price except few of them.In this case, you might need to change the product price to 4pd which is causing rounding issue and do some test by changing the decimal part till you get the correct result.
    – Asrar
    May 21, 2017 at 18:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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