Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Calculate_price with quantity is done wrong


Recommended Posts

So again,

 

function in currencies.php:
function calculate_price($products_price, $products_tax, $quantity = 1) {
      return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$_SESSION['currency']]['decimal_places']) * $quantity;
    }
 
Should be:
 
function calculate_price($products_price, $products_tax, $quantity = 1) {
      return tep_round(tep_add_tax($products_price, $products_tax) * $quantity, $this->currencies[$_SESSION['currency']]['decimal_places']);
    }
 
multiplication by quantity should be inside tep_round function.
Link to comment
Share on other sites

Archived

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

×
×
  • Create New...