Jump to content

Order total price calculation


lupus
 Share

Recommended Posts

Hello.
As I can see when the total product price is calculated (Order.php, line 575):

$total += floatval($row['product_price']) * $qty * (1 + $row['tax_rate'] / 100);


there is multiplication of price without tax, quantity and tax rate.

Honestly, I prefer to calculate product total like that:

$unit_with_tax = round(floatval($row['product_price']) * (1 + $row['tax_rate'] / 100), 2);
$total += $unit_with_tax * $qty;


so first the product unit price with tax is calculated, then the value is multiplied by quantity.
Any comments are welcomed.

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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More