Jump to content
Latest News: (loading..)
Sign in to follow this  
slupostrupek

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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×