UsrNems Posted March 17, 2015 Share Posted March 17, 2015 Hi, I'm getting trouble with my Presta. I've been looking all afternoon long for an answer and I've found many of them. So, here it is : First ! I've made a custom.php in / and set permisssions to 644 <?php require(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); Tools::redirect('index.php?controller=custom'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently'); Second ! I've made a CustomController in /controller/front/CustomController.php and set permissions to 644 <?php class CustomControllerCore extends FrontController { public $php_self = 'custom'; public function initContent() { parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'custom.tpl'); } } ?> Third ! For sure I've build a wonderful custom.tpl in /theme/personalTheme/custom.tpl and set permission to 604 <h1>MY WONDERFUL CUSTOM PAGE</h1> Fourth ! Came in to : /cache and deleted class_index.php Fifth ! Came in to /cache/smarty and deleted everything except index.php Six ! In my website's backoffice, I've been through SEO and added a new link: custom Seven ! In my website's backoffice, I've been through performances, and clear cache (And everything in this page has been turned to off) Eight ! Clear my browser cache Nine ! Killing myself with my mouseAnd after all these steps i'm still getting this error when i'm trying to go to : mywebsite.com/custom Fatal error: Class 'CustomController' not found in /home/geremesfcz/www/web/classes/controller/Controller.php on line 135 Oh I forgot, I also tried this : https://www.prestashop.com/forums/topic/250826-adding-a-new-page-controller-issue/?do=findComment&comment=1542578 Still this issue :'( Can you remove that gun off my head ? That would be great ! Thanks a lot ! P.S : I'm using Prestashop 1.6.0.11 1 Link to comment Share on other sites More sharing options...
Simone Salerno Posted March 18, 2015 Share Posted March 18, 2015 Have you tried putting CustomController.php in override/controllers/front instead of just controllers/front? (then you have to delete cache/class_index.php) Link to comment Share on other sites More sharing options...
UsrNems Posted March 19, 2015 Author Share Posted March 19, 2015 Hi Simone, & Thanks for your answer Yes I've already tried this, but it fails :/ Link to comment Share on other sites More sharing options...
UsrNems Posted March 19, 2015 Author Share Posted March 19, 2015 No one have an idea on what's causing this ? I'm stuck that problem and I can't continue my website because it's the last step to finish it :/ Link to comment Share on other sites More sharing options...
Simone Salerno Posted March 19, 2015 Share Posted March 19, 2015 (edited) I suppose your class should be named CustomController instead of CustomControllerCore. You still have to put it in the /override folder and delete class_index.php Edited March 19, 2015 by SimoneS93 (see edit history) Link to comment Share on other sites More sharing options...
UsrNems Posted March 19, 2015 Author Share Posted March 19, 2015 I suppose your class should be named CustomController instead of CustomControllerCore. You still have to put it in the /override folder and delete class_index.php Hi Simone ! Sadly I just tried this but it won't work. I tried with both CustomController & CustomControllerCore :/ Link to comment Share on other sites More sharing options...
Simone Salerno Posted March 19, 2015 Share Posted March 19, 2015 If you open class_index.php, do you find a record about your CustomController? If it exists, it shows where your class is. If it doesn't exists, there's a problem locating your file. Link to comment Share on other sites More sharing options...
UsrNems Posted March 19, 2015 Author Share Posted March 19, 2015 If you open class_index.php, do you find a record about your CustomController? If it exists, it shows where your class is. If it doesn't exists, there's a problem locating your file. No he doesn't find it :/ When I manually enter my class in this file, it work, but everytime it's recompiled it fly away :'( Link to comment Share on other sites More sharing options...
Simone Salerno Posted March 19, 2015 Share Posted March 19, 2015 (edited) This is all I can say: 1) make sure you put your CustomController.php file in /override/controllers/front folder 2) check you spelled correctly the class name and the file name 3) delete the closing ?> tag in the controller file (I read once it can cause troubles) I have several overrides in my shop (all AdminControllers, though) and they all work with no problem. You can also try making another override, maybe an Admin one, and see if this works (so you know it's a problem with ALL overrides or just that one) Edited March 19, 2015 by SimoneS93 (see edit history) Link to comment Share on other sites More sharing options...
UsrNems Posted March 23, 2015 Author Share Posted March 23, 2015 This is all I can say: 1) make sure you put your CustomController.php file in /override/controllers/front folder 2) check you spelled correctly the class name and the file name 3) delete the closing ?> tag in the controller file (I read once it can cause troubles) I have several overrides in my shop (all AdminControllers, though) and they all work with no problem. You can also try making another override, maybe an Admin one, and see if this works (so you know it's a problem with ALL overrides or just that one) Hi Simone and thanks again for your help. I tried removing the ?>, I didn't knew that it was causing troubles. But still no result. I'm always getting this error :/ Link to comment Share on other sites More sharing options...
Simone Salerno Posted March 23, 2015 Share Posted March 23, 2015 Have you tried other overrides? Link to comment Share on other sites More sharing options...
UsrNems Posted March 24, 2015 Author Share Posted March 24, 2015 Have you tried other overrides? Yep, no error 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