johnrobertson Posted August 25, 2018 Share Posted August 25, 2018 (edited) I have trouble understanding the instructions for override paths...http://doc.prestashop.com/display/PS16/Overriding+default+behaviors The files I want to override in version 1.6.2.20 are http://example.com/x/themes/default-bootstrap/js/order-opc.js and http://example.com/x/controllers/front/OrderOpcController.php Does anyone know a good guide or a quick answer? (I know that altering the original and re-naming the theme is a work around, but want to allow updates) John Edited August 25, 2018 by johnrobertson (see edit history) Link to comment Share on other sites More sharing options...
jgamio Posted August 26, 2018 Share Posted August 26, 2018 14 hours ago, johnrobertson said: I have trouble understanding the instructions for override paths...http://doc.prestashop.com/display/PS16/Overriding+default+behaviors The files I want to override in version 1.6.2.20 are http://example.com/x/themes/default-bootstrap/js/order-opc.js and http://example.com/x/controllers/front/OrderOpcController.php Does anyone know a good guide or a quick answer? (I know that altering the original and re-naming the theme is a work around, but want to allow updates) John 1- About changes on your theme You can't do override your themes files, you can create child themes but on 1.7 not on 1.6 if you need change some file just change but keep a track of your changes if you want keep update but I think you dont need worry too much about the theme update on 1.6 because is almost to end of live 2- to override the controller just go to the override directory and create your override files you can see the controller names something like NAMECore your new file name should be the same but change the class declaration original class NAMECore extends FrontController your file should be class NAME extends NAMECore after you need delete the class_index.php file on the cache directory 1 Link to comment Share on other sites More sharing options...
johnrobertson Posted August 26, 2018 Author Share Posted August 26, 2018 (edited) I think this is beyond me but thanks for help! I copied a file from/controllers/front/OrderOpcController.php to /override/controllers/front/x-orderopccontroller.phpI read the reply that says " class NAMECore extends FrontController your file should be class NAME extends NAMECore . ...I tracked this down to about the first line of text in my transplanted file. There are no other overrides in the directory to copy, but I tried changing it Mine orgininal said ... class OrderOpcControllerCore extends ParentOrderController My edited version said ... class OrderOpcController extends OrderOpcControllerCore I remembered to delete the cache file Unfortunately my test site showed an error message instead of the edited shopping cart page:Fatal error: Class 'orderopccontroller' not found in /classes/controller/Controller.php on line 134 I think I should find an easier work-around, but write this here in case anyone else has the same problem. Edited August 26, 2018 by johnrobertson line about deleting cache file (see edit history) Link to comment Share on other sites More sharing options...
eleazar Posted August 26, 2018 Share Posted August 26, 2018 Old PrestaShop releases contain every single empty master file for overrides in their override directory, except those for overriding the back office files, which is possible, too. Go to PrestaShop downloads Choose Previous releases Choose Older versions Choose for example release 1.5.3 Download the zip file and have a look into its override directory Or simply use the following download url: https://download.prestashop.com/download/releases/prestashop_1.5.3.0.zip?_ga=2.142362546.1486751929.1534879200-1861741334.1534879200 And don't forget that you need to refresh the smarty cache to make any override work 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