Jump to content

Rounding shipping costs


mohamed23

Recommended Posts

Hello Guys,

hope somone can help me

I'm trying to round shipping costs for some converted currencies using Tools::ps_round (shipping, 0);

so when I have £12.43, its rounded to $12.00, $15.60 rounded to $16.00 etc..

 

I managed to round  the shipping costs during the order process with an override on classes/cart.php : 

function getToltalShippingCost I set : 

if ($this->id_currency !=1)
        return Tools::ps_round($total_shipping, 0);
    else
    return $total_shipping;

On the front office it works shipping costs are rounded (payments etc ..)

But when the order is validated, the shipping cots are not rounded in the order detail, invoice etc..

 

 

thank you for your help

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 years later...
On 2/5/2018 at 4:10 PM, mohamed23 said:

Hello Guys,

hope somone can help me

I'm trying to round shipping costs for some converted currencies using Tools::ps_round (shipping, 0);

so when I have £12.43, its rounded to $12.00, $15.60 rounded to $16.00 etc..

 

I managed to round  the shipping costs during the order process with an override on classes/cart.php : 

function getToltalShippingCost I set : 

if ($this->id_currency !=1)
        return Tools::ps_round($total_shipping, 0);
    else
    return $total_shipping;

On the front office it works shipping costs are rounded (payments etc ..)

But when the order is validated, the shipping cots are not rounded in the order detail, invoice etc..

 

 

thank you for your help

 

Hello, i trying to do same on ps1.6, but cant get work, still have decimals in shipping prices, somebody have the workable solution?

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