RomsWebDesign Posted January 24, 2014 Share Posted January 24, 2014 (edited) Hi guys, I have dev a module witch override CategoryController. I would like that the override is install if the module is enabled. If you disable the module then uninstalls the override. How do I do this? Edited January 24, 2014 by RomsWebDesign (see edit history) Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted January 24, 2014 Share Posted January 24, 2014 hello with this $is_enabled = Module::isEnabled($module_name); Link to comment Share on other sites More sharing options...
RomsWebDesign Posted January 24, 2014 Author Share Posted January 24, 2014 Exactly. I have solved my issue. I do that and it seems to work. /** * Desactivate current module. * * @param bool $forceAll If true, disable module for all shop */ public function disable($forceAll = false) { // Disable module for all shops parent::disable($forceAll); if(!$this->isEnabled()) parent::uninstallOverrides(); } /** * Activate current module. * * @param bool $forceAll If true, enable module for all shop */ public function enable($forceAll = false) { if(parent::enable($forceAll)) parent::installOverrides(); } Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted January 24, 2014 Share Posted January 24, 2014 (edited) you most welcome please modify your post with issue is solved.. Edited January 24, 2014 by Nishith (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