stratboy Posted July 8, 2013 Share Posted July 8, 2013 (edited) Hi! I copied blocktopmenu in themes/[mytheme]/modules and changed code so that it can be placed in my custom displayHeaderMainMenuBox hook. It doesn't work. Instead, if I edit the same way the main (root) blocktopmenu, it works all fine. So, I guess the module override doesn't happen. Why? Edited July 8, 2013 by stratboy (see edit history) Link to comment Share on other sites More sharing options...
Piotr Kaczor Posted July 8, 2013 Share Posted July 8, 2013 You need to delete file /cache/class_index.php it will be regenarated with Your overrides? Link to comment Share on other sites More sharing options...
stratboy Posted July 8, 2013 Author Share Posted July 8, 2013 You need to delete file /cache/class_index.php it will be regenarated with Your overrides? I did, the file gets recreated, but the thing doesn't work. Link to comment Share on other sites More sharing options...
Piotr Kaczor Posted July 8, 2013 Share Posted July 8, 2013 (edited) Sorry I misunderstood when first reading I was thinking about something else Did You put module CSS files in themes/[mytheme]/css/modules/blocktopmenu and JS themes/[mytheme]/js/modules/ Edited July 8, 2013 by Piotr Kaczor (see edit history) Link to comment Share on other sites More sharing options...
stratboy Posted July 8, 2013 Author Share Posted July 8, 2013 (edited) Sorry I misunderstood when first reading I was thinking about something else Did You put module CSS files in themes/[mytheme]/css/modules/blocktopmenu and JS themes/[mytheme]/js/modules/ Hi, thank you. I don't need to change css/js files. Is still necessary correct the paths? I've only modified (added a line to install()) php code simply to add my custom hook: $this->registerHook('displayHeaderMainMenuBox') And of course the relative uninstall code. displayHeaderMainMenuBox is the new hook, already used with other modules. Edited July 8, 2013 by stratboy (see edit history) Link to comment Share on other sites More sharing options...
stratboy Posted July 8, 2013 Author Share Posted July 8, 2013 Wait a minute: http://doc.prestashop.com/display/PS15/Overriding+default+behaviors#Overridingdefaultbehaviors-Overridingamodule%27sbehavior They speak about tpl, css and js. NOT php. Maybe in a theme folder I can override ONLY a modules tpl/css/js? And in that case, maybe I can override the php file in the /override folder just like classes and controllers? OR maybe i CANNOT override module's php files? Effectively, on the top of the link, they write: 1. Overriding PrestaShop's own behavior (class files and controller files) in order to target a specific section of the required components. 2. Overriding the VISIBLE PARTS of modules (Templates, JavaScript, style sheet language...) so that the themes can adapt better to them. mmmmm 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