NemoPS Posted January 19, 2015 Share Posted January 19, 2015 Although it's about core development, this topic will certainly interest template developers as well. YES! We can finally override modules from other modules, since the nre 1.6.0.11. Yes, no mention in the changelog Here is my tut! http://nemops.com/override-prestashop-modules-core/#.VLze2EejOr0 3 Link to comment Share on other sites More sharing options...
razaro Posted January 19, 2015 Share Posted January 19, 2015 Thanks great and quick tutorial :-) Think it is good option to theme developers to pack overrides in one module. Also to watch out for possible conflicts when doing overrides. Link to comment Share on other sites More sharing options...
dioniz Posted January 19, 2015 Share Posted January 19, 2015 Thanks for this very useful info and for explanation how it works. Link to comment Share on other sites More sharing options...
Krystian Podemski Posted January 19, 2015 Share Posted January 19, 2015 Good tutorial Nemo, however there is no need to delete class_index.php 1 Link to comment Share on other sites More sharing options...
oldlastman Posted March 5, 2015 Share Posted March 5, 2015 (edited) Hello, it's posible with that method make overrides like ?? override/modules/paymodule/controllers/front/module.php ?? i'm trying but.. no results thanks Edited March 5, 2015 by oldlastman (see edit history) Link to comment Share on other sites More sharing options...
Krystian Podemski Posted March 5, 2015 Share Posted March 5, 2015 No, you can only override base file of the module 1 Link to comment Share on other sites More sharing options...
NemoPS Posted March 6, 2015 Author Share Posted March 6, 2015 Oh, there is a bug concerning class_index.php in .09, but it should be there in .11, is it not? My version has it Link to comment Share on other sites More sharing options...
Krystian Podemski Posted March 6, 2015 Share Posted March 6, 2015 (edited) What bug? Overrides for modules works properly from 1.6.0.13 Edited March 6, 2015 by Krystian Podemski (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted March 6, 2015 Author Share Posted March 6, 2015 And class_index is not there? I admit I didn't try out that version yet. 1.6.0.9 has a bug in PrestashopAutoload.php, the class_index file never gets generated Link to comment Share on other sites More sharing options...
Krystian Podemski Posted March 6, 2015 Share Posted March 6, 2015 (edited) Modules are not autoloaded so there is no need to autoload overrides, and I didn't notice any problems with class_index.php regeneration Edited March 6, 2015 by Krystian Podemski (see edit history) Link to comment Share on other sites More sharing options...
javierllinas Posted June 4, 2015 Share Posted June 4, 2015 (edited) Can't get this to work with blocklayered I want to tweak the title output this way https://www.prestashop.com/forums/topic/392632-page-title-coming-in-the-category-heading-after-selecting-a-layed-in-layered-navigation-module/?do=findComment&comment=1917643 I'm trying to override ajaxcall() within 'blocklayered.php': if (!defined('_CAN_LOAD_FILES_')) exit; class BlockLayeredOverride extends BlockLayered { public function ajaxCall(){ ... Edited June 4, 2015 by javierllinas (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted June 5, 2015 Author Share Posted June 5, 2015 I'm not sure that will work, since the file is included manually in blocklayered-ajax.php Link to comment Share on other sites More sharing options...
javierllinas Posted June 5, 2015 Share Posted June 5, 2015 That's what I thought. I don't know if blocklayered-ajax.php can be overriden somehow... Link to comment Share on other sites More sharing options...
NemoPS Posted June 5, 2015 Author Share Posted June 5, 2015 Nope, it's actually an "external" file so it can't. You might want to hardcode the modification and keep a backup of it in case your upgrade Link to comment Share on other sites More sharing options...
javierllinas Posted June 5, 2015 Share Posted June 5, 2015 (edited) That's true. What I'm going to do is duplicate the module, as I modified some tpl, to build a 'new' one. What we learn here is that we cannot override all kind of modules, I guess. As always, thanks for the feedback Nemo1 All the best. Edited June 5, 2015 by javierllinas (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted June 6, 2015 Author Share Posted June 6, 2015 Yeah, correct. Also, Some of them have private methods which cannot obviously be overridden. Which also makes overrides useless in the first place Link to comment Share on other sites More sharing options...
innovacy Posted June 6, 2015 Share Posted June 6, 2015 (edited) http://nemops.com/override-prestashop-modules-core/#.VLze2EejOr0 Quote from website: Since this silence towards the community is getting pretty annoying, I hope the Prestashop team will soon try to have more consideration for the user and developers base, informing us when such a new feature is released. Just a small code snippet for them: 2 if($prestashop - $community) die(); I think they heard you Probably many developers still don't know about it as the introduction was a little "silent": http://build.prestashop.com/ http://build.prestashop.com/howtos/module/how-to-override-modules/ Edited June 6, 2015 by innovacy (see edit history) 1 Link to comment Share on other sites More sharing options...
NemoPS Posted June 8, 2015 Author Share Posted June 8, 2015 Yeah I know about it since a while I hope they will keep updating 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