cristic Posted June 19, 2017 Share Posted June 19, 2017 I have a question a little bit advanced in regards to function override for a core class from a module. Standard way is to place the override in /modules/my_module/override/classes/XXX.php and PS install() function will handle all the rest. But what if the function that is being overridden has different parameters between PS versions? This will require different override files and a way to use the correct one upon install. But is there a way to accomplish this automatically? One way that I was thinking is to leave the folder /modules/my_module/override/classes/ empty and on install function, before calling parent::install() - first to copy the correct file based on the actual PS version, where the module is installed. Is there another way to do this? Link to comment Share on other sites More sharing options...
joseantgv Posted June 19, 2017 Share Posted June 19, 2017 I have a question a little bit advanced in regards to function override for a core class from a module. Standard way is to place the override in /modules/my_module/override/classes/XXX.php and PS install() function will handle all the rest. But what if the function that is being overridden has different parameters between PS versions? This will require different override files and a way to use the correct one upon install. But is there a way to accomplish this automatically? One way that I was thinking is to leave the folder /modules/my_module/override/classes/ empty and on install function, before calling parent::install() - first to copy the correct file based on the actual PS version, where the module is installed. Is there another way to do this? I think that this is a smart way of doing it. 1 Link to comment Share on other sites More sharing options...
cristic Posted June 21, 2017 Author Share Posted June 21, 2017 (edited) Thank you @joseantgv - I was looking to see if there is another possible solution. I will eventually use this one for now. Edited June 21, 2017 by cristic (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now