bitshok Posted April 2, 2013 Share Posted April 2, 2013 Hello! I have prestashop 1.5.4 on my localhost and I can't figure it out how to override the FrontController.php This is what it contains: <?php class FrontController extends FrontControllerCore { public function displayHeader() { die('eu'); self::$smarty->assign('currentController', get_class($this)); return parent::displayHeader(); } } I've put this file on /override/classes/controller/ than in /modules/mymodule/override/classes/controller/ where mymodule is a module that i have installed, and nothings happens. Also tried other functions from FrontController and nothing changes. I've managed to override ProductController.php from /controller/ folder, but everything that I've tried to override from the /classes/ doesn't seem to work. Thank you for your help! Link to comment Share on other sites More sharing options...
Rhapsody Posted April 2, 2013 Share Posted April 2, 2013 Try changing the return to what is referenced in the original FrontController.php return Controller::displayHeader(); Link to comment Share on other sites More sharing options...
bitshok Posted April 3, 2013 Author Share Posted April 3, 2013 Try changing the return to what is referenced in the original FrontController.php return Controller::displayHeader(); This can't change anything because I have the die() function first, if the override would work I expect to see some errors on front page, but everything remains the same. Link to comment Share on other sites More sharing options...
mopi Posted April 4, 2013 Share Posted April 4, 2013 (edited) I have the same problem , beffore 1.5.4 override FrontController whas working , but now : no working . the class_index.php is now without override , so : you have to add, line 327 in cache/class_index.php : 'FrontController' => 'override/classes/controller/FrontController.php', Edited April 4, 2013 by mopi (see edit history) 4 Link to comment Share on other sites More sharing options...
bitshok Posted April 4, 2013 Author Share Posted April 4, 2013 Thank you! This does the job you have to add, line 327 in cache/class_index.php : 'FrontController' => 'override/classes/controller/FrontController.php', I'll also submit an issue. Link to comment Share on other sites More sharing options...
l2c2 Posted June 5, 2013 Share Posted June 5, 2013 Thanks ! Link to comment Share on other sites More sharing options...
Dejv Posted July 12, 2013 Share Posted July 12, 2013 (edited) I have the same problem , beffore 1.5.4 override FrontController whas working , but now : no working . the class_index.php is now without override , so : you have to add, line 327 in cache/class_index.php : 'FrontController' => 'override/classes/controller/FrontController.php', Great! Now it works! Thanks Edited July 12, 2013 by DejvCZ (see edit history) Link to comment Share on other sites More sharing options...
makinero Posted October 20, 2016 Share Posted October 20, 2016 I have the same problem , beffore 1.5.4 override FrontController whas working , but now : no working . the class_index.php is now without override , so : you have to add, line 327 in cache/class_index.php : 'FrontController' => 'override/classes/controller/FrontController.php', Just delete cache/class_index.php it will be re-generated. I tried to do the same but it does not work : <?php class FrontController extends FrontControllerCore { public function setMedia() { $this->addJS(_THEME_JS_DIR_.'file.js'); return parent::setMedia(); } } 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