endriudb Posted August 7, 2014 Share Posted August 7, 2014 Hi all! I'm working on a module and I use the hookDisplayAdminProductsExtra to show the module's control panel to users. It's ok on the PS versions >= 1.5.4.0. Today I was testing on the 1.5.0.1 version and I found that my custom tab is not showing at all in the list on the left.. I suppose my code is correct (with the newer versions it works).. maybe I need to use some particular way to implement the hookDisplayAdminProductsExtra in this PS version? Thanks Link to comment Share on other sites More sharing options...
vekia Posted August 17, 2014 Share Posted August 17, 2014 can you show a part of hook funtion that you use? also, do you see some errors ? hook you mentioned (and your module) appears on modules > positions section ? Link to comment Share on other sites More sharing options...
endriudb Posted September 1, 2014 Author Share Posted September 1, 2014 can you show a part of hook funtion that you use? also, do you see some errors ? hook you mentioned (and your module) appears on modules > positions section ? Sorry for being late in answering, I returned in the office today No, there are no errors and yes, the hook appears and it seems to be connected with my module. Here is the code I use: Constructor of the class public function __construct() { $this->name = 'roundview'; $this->tab = 'front_office_features'; $this->version = '1.7.5'; $this->author = 'NORZ SRL'; $this->need_instance = 0; $this->ps_versions_compliancy = array('min' => '1.5', 'max' => '1.6'); $this->bootstrap = true; $this->roundview_img_upload_path = _PS_IMG_DIR_.'roundview'; parent::__construct(); $this->displayName = $this->l('Roundview'); $this->description = $this->l('Give your products a wonderful 360 view!'); $this->confirmUninstall = $this->l('Are you sure you want to uninstall? The folder with all your -360 view- images will be deleted! Be sure to have a backup before proceeding.'); } Registering the hook in the install method public function install() { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); if (!parent::install() || !$this->registerHook('displayAdminProductsExtra') || !$this->registerHook('displayRightColumnProduct') || !$this->registerHook('displayHeader') || !$this->registerHook('displayBackOfficeHeader') || ) return false; return true; } The hook's method public function hookDisplayAdminProductsExtra($params) { $id_product = (int)Tools::getValue('id_product'); if (Validate::isLoadedObject($product = new Product($id_product))) { $images = Db::getInstance()->ExecuteS('SELECT .....'); $active = Db::getInstance()->ExecuteS('SELECT .....'); $this->context->smarty->assign(array( 'id_product' => $id_product, 'roundview_images' => $images, 'active' => (!empty($active[0]) ? $active[0]['active'] : false), 'base_dir' => _PS_BASE_URL_.__PS_BASE_URI__ )); return $this->display(__FILE__, 'views/templates/admin/RoundviewForm.tpl'); } } All the other code is to uninstall the module or to handle other various hooks. Is there something that doesn't work with the 1.5.0.1 PS version? Link to comment Share on other sites More sharing options...
vekia Posted September 1, 2014 Share Posted September 1, 2014 have you tried to reinstall module? if you added tab hook support after installation, it will not appear there Link to comment Share on other sites More sharing options...
endriudb Posted September 1, 2014 Author Share Posted September 1, 2014 have you tried to reinstall module? if you added tab hook support after installation, it will not appear there Yes, I tried to reinstall several times but nothing changed.. Link to comment Share on other sites More sharing options...
bbosternak Posted January 12, 2015 Share Posted January 12, 2015 Hi!I have the same problem. On 1.5.3.1 and above it works, but in 1.5.0.1 it is not visible under product tabs. In Modules > Positions is listed on the bottom of the list with block header: displayAdminProductsExtra - 1 module (Technical name: displayAdminProductsExtra) My code is similar to endriudb's Link to comment Share on other sites More sharing options...
vekia Posted January 12, 2015 Share Posted January 12, 2015 im affraid that it's a prestashop bug, that was solved in next releases of 1.5.x it's worth to note, that prestashop 1.4.x hasn't got this hook at all, so in 1.5.0.1 it was first release that contained support of this hook. 1 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