Jump to content

Turn off module when installing new one


Recommended Posts

Hi!

I want to turn off ps_customersignin module when I install my new module because it literally replace this module, in install function I did:

 

  $query = 'UPDATE `ps_module` SET `active` = "0" WHERE `name` = "ps_customersignin"';
    
    return parent::install()
        && $this->registerHook('displayNav2')
        && $this->registerHook('header')
        && $this->registerHook('actionFrontControllerSetMedia')
        && Db::getInstance()->ExecuteS($query)
        && $this->_clearCache('*');


It changes value in database but It doesnt seem to turn off module is there any way to turn off module when I install another module? I have lastest Presta version, clear install.
 

Link to comment
Share on other sites

I found out solution - disableByName is deprecated but using 

   

Module::getInstanceByName('ps_customersignin')->disable();

Works just fine and after uninstalling 

   

Module::getInstanceByName('ps_customersignin')->enable();

And everything seems fine :)

  • Like 1
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...