Jump to content

Module two times installed


Recommended Posts

Hello,

 

i developed a module, but when installing i have it two times in hook and i also have to uninstall the same module two times ?

 

I used the standard install and uninstall function from guide:

public function install()
{
if (!parent::install() ||
!$this->installDB() ||
!$this->registerHook('header') ||
!$this->registerHook('displayProductButtons') ||
!Configuration::updateValue('PLM_NAME', 'tal2pl') ||
!Configuration::get('PS_LANG_DEFAULT')
)

return false;

return parent::install() 
&& $this->registerHook('displayProductButtons') 
&& $this->registerHook('header') 
&& Configuration::updateValue('PLM_NAME', 'tal2pl')
&& Configuration::get('PS_LANG_DEFAULT');

}
public function uninstall()
{
if (!parent::uninstall() ||
!Configuration::deleteByName('PLM_NAME')
)

return false;

Configuration::deleteByName('PLM_NAME');
return parent::uninstall();

}
Edited by Tahsin_85 (see edit history)

Share this post


Link to post
Share on other sites

 

Hello,

 

i developed a module, but when installing i have it two times in hook and i also have to uninstall the same module two times ?

 

I used the standard install and uninstall function from guide:

public function install()
{
if (!parent::install() ||
!$this->installDB() ||
!$this->registerHook('header') ||
!$this->registerHook('displayProductButtons') ||
!Configuration::updateValue('PLM_NAME', 'tal2pl') ||
!Configuration::get('PS_LANG_DEFAULT')
)

return false;

return parent::install() 
&& $this->registerHook('displayProductButtons') 
&& $this->registerHook('header') 
&& Configuration::updateValue('PLM_NAME', 'tal2pl')
&& Configuration::get('PS_LANG_DEFAULT');

}
public function uninstall()
{
if (!parent::uninstall() ||
!Configuration::deleteByName('PLM_NAME')
)

return false;

Configuration::deleteByName('PLM_NAME');
return parent::uninstall();

}

 

 

Do, you don't need to call it twice.

Share this post


Link to post
Share on other sites

Where i am calling it twice ?

 

You should do it this way:

public function install()
{
    if (!parent::install() ||
        !$this->installDB() ||
        !$this->registerHook('header') ||
        !$this->registerHook('displayProductButtons') ||
        !Configuration::updateValue('PLM_NAME', 'tal2pl') ||
        !Configuration::get('PS_LANG_DEFAULT')) {
        return false;
    }

    return true
}

public function uninstall()
{
    if (!parent::uninstall() ||
        !Configuration::deleteByName('PLM_NAME')) {
        return false;
    }

    return true;
}

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More