Jump to content

Order total price calculation


lupus

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.

Link to comment
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
×
×
  • Create New...