module_developer Posted May 13, 2013 Share Posted May 13, 2013 I am a newbie to the prestashop modules development. Currently I have developed a module. It is working fine in backend (like update and delete inserted values). But when I tried to check the function of the module from frontend it is not showing. My code for install the module is look like this public function install() { if(!parent::install()) return false; if (!$this->registerHook('leftColumn')) return false; if (!$this->registerHook('header')) return false; if (!$this->registerHook('rightColumn')) return false; return true; } The code for the hook is like this public function hookHome($params) { global $cookie, $smarty; $value=array(); ..................... ............ return $this->display(__FILE__, 'filename.tpl'); } I have tried many methods to show the module in left column and the right column of the page but its not showing there. But when I tried to transplant the module from admin->modules->positions->transplant a module->hook into->displayHome (Homepage content) . it worked in homepage content. But I want to show them in left and right column also. I have tried to use live edit but the module is not showing in left and right column at all. So can someone tell me what is the wrong here? Any help and suggestions will be really appreciable. Thanks. Link to comment Share on other sites More sharing options...
vekia Posted May 13, 2013 Share Posted May 13, 2013 your installation function looks weirdy, try with something like this: function install(){ if (!parent::install() || !$this->registerHook('leftcolumn') || !$this->registerHook('rightcolumn') || !$this->registerHook('home')) return false; return true; } then you have to use this functions: public function hookHome($params){ return $this->display(__FILE__, 'filename.tpl'); } public function hookleftcolumn($params){ return $this->display(__FILE__, 'filename.tpl'); } public function hookrightcolumn($params){ return $this->display(__FILE__, 'filename.tpl'); } Link to comment Share on other sites More sharing options...
Recommended Posts