Isb Posted November 21, 2013 Share Posted November 21, 2013 (edited) Hi guys, this is the code of my module: <?php if ( ! defined( '_PS_VERSION_' ) ) exit; class Skema extends Module{ public function __construct(){ $this->name = 'skema'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Ivano Mercuri'; $this->need_instance = 0; $this->ps_versions_compliancy = array( 'min' => '1.5.4.1' , 'max' => '1.6'); parent::__construct(); $this->displayName = $this->l('Modulo: Skema'); $this->description = $this->l('Apporta modifiche al Front End'); $this->confirmUninstall = $this->l('Lo vuoi disinstallare?'); } public function install(){ if( Shop::isFeatureActive() ){ Shop::setContext( Shop::CONTEXT_ALL ); } return parent::install() && $this->registerHook( 'displayFooter' ) && $this->registerHook( 'top' ); } public function uninstall(){ return parent::uninstall(); } public function hookDisplayFooter( $params ){ if( $_COOKIE['popup_isw'] != 'yes' ){ return $this->display( __FILE__ , 'skema.tpl' ); } } public function hookTop( $params ){ $this->context->controller->addCSS( $this->_path . 'css/skema.css' , 'all' ); $this->context->controller->addJS( $this->_path . 'js/skema.js' , 'all' ); } } It's a poorly code i edited from the documentation about the development of a module. If I install the module by clicking install, the BO shows me the successful installation of the module, without any errors... But the module itself is still uninstalled. These are two screenshots about this problem: 1) At the module line, it is installed, but the label next to the module title says it is not 2) At the top of Admin it says the module has been installed with no other warnings There are no php errors or other errors for PS. Any help to resolve this problem? Edited November 21, 2013 by Isb (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted November 21, 2013 Share Posted November 21, 2013 can you try to return true in install function() ? Link to comment Share on other sites More sharing options...
Isb Posted November 22, 2013 Author Share Posted November 22, 2013 can you try to return true in install function() ? Are you suggesting me to implement this way to see what will happen? public function install(){ /* if( Shop::isFeatureActive() ){ Shop::setContext( Shop::CONTEXT_ALL ); } return parent::install() && $this->registerHook( 'displayFooter' ) && $this->registerHook( 'top' ); */ return true; } Link to comment Share on other sites More sharing options...
vekia Posted November 22, 2013 Share Posted November 22, 2013 soemthing like: if (parent::install() && $this->registerHook( 'displayFooter' ) && $this->registerHook( 'top' )){ return true; } else{ return false; } Link to comment Share on other sites More sharing options...
Isb Posted November 22, 2013 Author Share Posted November 22, 2013 soemthing like: if (parent::install() && $this->registerHook( 'displayFooter' ) && $this->registerHook( 'top' )){ return true; } else{ return false; } Actually, it worked... but it is the same algorithm, is it? 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