Jump to content

Custom Rounding type


cantcloseaccount
 Share

Recommended Posts

Hi All,

 

I'm a relative novice when it comes to PHP so please excuse me if I am way off tangent. I would really appreciate any feedback or help.

 

I'm trying to implement a custom rounding function to mirror an existing pricing sturcture.

 

I have created a custom rounding type and defined it in

 

AdminPrefencesController.php

defines.inc.php

 

I am now in the process of trying to integrate the custom function into tools.php which I have copied to the overrides folder.

 

The current format has an if elseif statement to call the PS_ROUND_UP and PS_ROUND_DOWN modes.

 

I'm guessing with 3 different modes to call, I will need to change that to a Switch?

 

Here is a sample of what I have done. If anyone has any advice, it would be muchly appreciated!

 

Thanks

Louis

 

Attached Code

MetroRound.php

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