Jump to content

Rounding Total Price to the nearest 5c


Recommended Posts

I needed a way of rounding the total amount to the nearest 5c.

Add the extra line in classes/Cart.php
Around line 640

if ($discount->id_discount_type != 3)
{
   $order_total -= floatval($discount->getValue(sizeof($discounts), $order_total_products, $shipping_fees, $this->id, intval($withTaxes)));

   <!-- Add this line below, which rounds the total to the nearest 5c -->
   $order_total = round(floatval($order_total) *2, 1) /2;
}


Works a treat!

Cheers
Mike

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...