Tahsin_85 Posted March 24, 2017 Share Posted March 24, 2017 (edited) 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 March 24, 2017 by Tahsin_85 (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted March 24, 2017 Share Posted March 24, 2017 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. Link to comment Share on other sites More sharing options...
Tahsin_85 Posted March 24, 2017 Author Share Posted March 24, 2017 Where i am calling it twice ? Link to comment Share on other sites More sharing options...
joseantgv Posted March 24, 2017 Share Posted March 24, 2017 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; } Link to comment Share on other sites More sharing options...
Tahsin_85 Posted March 27, 2017 Author Share Posted March 27, 2017 All right, thank you 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