bluego78 Posted November 6, 2012 Share Posted November 6, 2012 Hi, i'm trying to do a simple override to Product Class but this doesn't work. In override/classes/Product.php i have class Product extends ProductCore { public function my_function() { return 'hello world'; } } If i try to call from a module Product::my_function(); the page return error on the browser. I've tried also public static function but it's the same thing.... and i've tried also to do: $p = new Product(); $p->my_function(); Nothing to do... Where is my mistake? Please help me! Link to comment Share on other sites More sharing options...
bluego78 Posted November 8, 2012 Author Share Posted November 8, 2012 up Link to comment Share on other sites More sharing options...
VaB23 Posted November 8, 2012 Share Posted November 8, 2012 (edited) Today I've installed prestashop 1.5.2. At me doesn't work to override the FrontController that came with an overridden file... To do that I modified the base file to do an redirect into maintenance method. I know isn't a good choice but is for moment. I've trusted in prestashop but came to be useless. Edited November 8, 2012 by VaB23 (see edit history) Link to comment Share on other sites More sharing options...
bluego78 Posted November 9, 2012 Author Share Posted November 9, 2012 Yes i've tested also for controllers... Override doesn't work... It's a very big problem... I still hope to be wrong... Someone can tell me that i'm wrong please? Link to comment Share on other sites More sharing options...
Big_Berny Posted November 10, 2012 Share Posted November 10, 2012 Same here! Override doesn't work! Help! Link to comment Share on other sites More sharing options...
Big_Berny Posted November 10, 2012 Share Posted November 10, 2012 I found the solution for my problem: I just had to delete "cache/class_index.php" (eventough I hadn't enabled cache), so that this file get's re-created (happens automatically). The problem was that I renamed the override-folder to debug a problem. And that appears to change that file I mentioned above so that prestashop doesn't recognize the override-folder anymore when you rename it back. Try it out. 3 Link to comment Share on other sites More sharing options...
VaB23 Posted November 10, 2012 Share Posted November 10, 2012 Many Thanks Big_Berny, you found the solution for me . Just I disabled cache, and overriden controller it's working. Link to comment Share on other sites More sharing options...
vivek tripathi Posted June 6, 2013 Share Posted June 6, 2013 (edited) Many Thanks Big_Berny, you found the solution for me . I removed file cache/class_index.php and it working... It is really helpful for me it is just similar to life saving help. It doesn't matter you have enabled cache or not. I found after each time you override class or controller you have to delete that file to take effect of overriding once you run site that file automatically generated that having record of all your core as well as overridden controller and class file details. If you are changing in same overridden class/ controller you don't need to delete file again and again. Edited June 6, 2013 by vivek tripathi (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