mali8 Posted March 13, 2013 Share Posted March 13, 2013 Hello, I try to make a PrestaShop module, for PrestaShop versin 1.5.3.1. I used this guide to make it: http://doc.prestasho...estaShop+module But when I got to the Hooking a module chapter. The PrestaShop do not let to "Transplant a module"? Can anyone help me? Or just post a tutorial that work's Sorry for bad English. Thanks for the reply. Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2013 Share Posted March 13, 2013 which hooks you use in your module? By this i mean which hooks you register with install() function and where you want to transplant it? Link to comment Share on other sites More sharing options...
mali8 Posted March 13, 2013 Author Share Posted March 13, 2013 I whant to make leftColumn hook Link to comment Share on other sites More sharing options...
mali8 Posted March 13, 2013 Author Share Posted March 13, 2013 (edited) My .php file look's like this, i just copy/paste from this tutorial , just want to see how it work's. mojmodul.php <?php if (!defined('_PS_VERSION_')) exit; class MojModul extends Module { public function __construct() { $this->name = 'mojmodul'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Neme name'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.5'); // $this->dependencies = array('blockcart'); parent::__construct(); $this->displayName = $this->l('Moj Modul'); $this->description = $this->l('News če bo le šlo.'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall?'); if (!Configuration::get('mojmodul')) $this->warning = $this->l('No name provided'); } } public function install() { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); return parent::install() && $this->registerHook('leftColumn') && $this->registerHook('header') && Configuration::updateValue('mojmodul', 'my friend'); } } public function uninstall() { if (!parent::uninstall() || !Configuration::deleteByName('mojmodul')) return false; return true; } public function hookDisplayLeftColumn($params) { $this->context->smarty->assign( array( 'my_module_name' => Configuration::get('MYMODULE_NAME'), 'my_module_link' => $this->context->link->getModuleLink('mojmodul', 'display') ) ); return $this->display(__FILE__, 'mojmodul.tpl'); } public function hookDisplayRightColumn($params) { return $this->hookDisplayLeftColumn($params); } public function hookDisplayHeader() { $this->context->controller->addCSS($this->_path.'css/mojmodul.css', 'all'); } ?> Edited March 13, 2013 by mali8 (see edit history) Link to comment Share on other sites More sharing options...
mali8 Posted March 13, 2013 Author Share Posted March 13, 2013 I maneged to make the module Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2013 Share Posted March 13, 2013 so it works exactly as you want now? Link to comment Share on other sites More sharing options...
mali8 Posted March 13, 2013 Author Share Posted March 13, 2013 Not yet i will fisnish it tomorrow... Link to comment Share on other sites More sharing options...
vekia Posted March 13, 2013 Share Posted March 13, 2013 but you can transplant it? I ask because I want to mark the post as solved Link to comment Share on other sites More sharing options...
mali8 Posted March 14, 2013 Author Share Posted March 14, 2013 mark it as solved... Link to comment Share on other sites More sharing options...
vekia Posted March 20, 2013 Share Posted March 20, 2013 thanks, so i marked it as solved and what about your module? is your solution ready now? Link to comment Share on other sites More sharing options...
Recommended Posts