Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Bug on little amount with taxe in shopping cart


Gyakutsuki

Recommended Posts

Hi,

 

I think i found a little bug in the shopping cart.

If you put a little amount for a product , ex : 1.23€ with a taxe 19.6% for example, you have 1.4711 with taxe

 

In catalog you take 20 products

the price display is : 1.47 for one product

Now in the shopping cart you see the total product price : 29.42EUR with taxe

And the total amount in shopping cart is : Sub total : 29.40EUR with taxe

 

We have a difference 0.2 EUR.

 

The difference between the amount is the taxe. Il 's not well calculated, because there is a difference between 2 number after the comma and 4 number after the comma. And oscommerce realise and round after 2 commas. (ex 1.7859 become 1.79)

 

And the total amount is based on 1.79

and the total product is based on 1.7859

 

Note :

-without taxe there is no problem

- with attribute price is ok for the amount for the attribute. Only the price product put a problem.

- For the big amount, the problem does'nt appear ex : 100*1.196 = 119.6 (just if the number has 3 number after the coma).

 

Do you have a solution, an idea to resolve this ?

 

Thank you for your answer and test and idea.

 

Oscommerce RC2a

 

 

 

 


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

Hi,

 

I found a solution for resolve this problem, I don't if it's perfectly.

 

The problem come in classes /shopping cart with this function : calculate_price in currencies.php

I think it's a new function introduced in the latest oscommerce

 

To resolve

replace in classes/shopping cart this

// $this->total += $currencies->calculate_price($products_price, $products_tax, $qty);

$this->total += tep_add_tax($products_price, $products_tax) * $qty;

 

And the calcul is ok

 

see also this forum http://www.oscommerce.com/forums/index.php?showtopic=317838


Regards
-----------------------------------------
Loïc

Contact me by skype for business
Contact me @gyakutsuki for an answer on the forum

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...