jahyax Posted May 29, 2013 Share Posted May 29, 2013 Good day everyone i am fairly new to prestashop and programming, I am a little bit confused in overriding my question is: when overriding a controller or a class, do i need to copy the code of the original class or controller in my override , or just simply making the my own override and put the code that i want. thank you! Link to comment Share on other sites More sharing options...
vekia Posted May 30, 2013 Share Posted May 30, 2013 You can put there the code you want, if you don't want to change sources of the original functions - you don't have to copy contents of original file to the override Link to comment Share on other sites More sharing options...
PascalVG Posted May 30, 2013 Share Posted May 30, 2013 Normally you override and only define the changed functions in the overriding class. The non changed functions are 'inherited' from the overriden (base/original) class. Here some examples: http://www.prestashop.com/blog/en/modules_classes_and_controller_override_by_julien_breux/ hope this helps, pascal Link to comment Share on other sites More sharing options...
madowen Posted May 31, 2013 Share Posted May 31, 2013 What if I only want to change the template showed by a controller? Do I have to copy the function and only change the template? Link to comment Share on other sites More sharing options...
jahyax Posted May 31, 2013 Author Share Posted May 31, 2013 (edited) vekia and pascal, thanks for the insight. and thank for the link also, this will help a lot Edited May 31, 2013 by jahyax (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