Jump to content

How to change final order total with overriding Cart.php ?


Codify Solutions
 Share

Recommended Posts

Hello Everyone,

 

I have a problem to changing order total. What I did I put Cart.php on override folder and put getOrderTotal function there.

I want to add suppose $10 on final total means Total after Tax ( Grand Total ).

 

I put my code before

return Tools::ps_round((float)$order_total, $compute_precision);

 

I added

if ( my condition ) {

  $order_total += $myvalue;

}

 

In this getOrderTotal function it goes many times I think whenever getOrderTotal calls on payment page.
 

but it add that amount on Total products not the final amount, so when I proceed with the order it won't change the final amount of the order.

 

Please help. Thanks !

 

 

Share this post


Link to post
Share on other sites

  • 5 years later...

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