Jump to content


Corporate Sponsors


Latest News: (loading..)

- - - - -

Order sub-totals inaccuracy


  • You cannot reply to this topic
1 reply to this topic

#1 mghay

  • Community Member
  • 34 posts
  • Real Name:Mike Haylett

Posted 15 March 2011, 21:37

Using V2.2 I have discovered a glitch with the calculation of tax for orders of multiple products. This is best seen on the Order Confirmation page.

The cost of multiple products is listed correctly (e.g. 19 x Widgets 119,70 EUR) but the subsequent sub-total is incorrect (e.g. Sub-Total: 119,76 EUR)

I can see in checkout_confirmation.php that in the first case the tax is applied to the products_price first, then the order quantity to produce the correct result. However, the Sub-Total is derived from order_total_modules->output which must use the products_price x qty x tax formula which, thanks to multiple decimal points and subsequent rounding, produces the incorrect result (customers buy a tax-inclusive priced product rather than have tax added separately at the till!). This incorrect result is then used throughout the subsequent billing, invoicing, etc. It's only a matter of a few cents but it stands out on the invoice.

I would like to alter this incorrect order of calculation but I am unable to locate just where it is buried. I have searched through the various directories but although order_total.php looks to be the most obvious, I can't see that function anywhere.

If anyone can point me in the right direction or offer any other help, I would be most grateful.

#2 candycanes

  • Community Member
  • 18 posts
  • Real Name:Candy
  • Gender:Female

Posted 07 June 2011, 14:49

Hi, did you ever get anywhere with this?

I have a shop and whilst my accounting software works out UK VAT on a product by product basis, OSC Order Total seems to work tax out at the end as a lump added onto the subtotal of all the ex-VAT product prices.

I inherited the shop and this is something that has always bugged me, but really not sure how to go about fixing it, as it seems there could be a lot of knock on effects to code elsewhere?

Thanks!