shinobi80 Posted May 10, 2017 Share Posted May 10, 2017 Hello Tous, Je vais finir par devenir chèvre avec la MAJ de presta que je viens de faire 1.4 vers 1.6 J'ai corrigé les petits bugs reste un problème majeur pour lequel je ne trouve pas de solution. J'aimerais afficher mon menu dans une barre horizontale. le hook en question est menutop il était précédemment appelé comme suit {$HOOK_MENUTOP} j'ai changé cet appel en {hook h='menutop'} ce qui m'a supprimé cet erreur qui apparaissait en front Undefined index: HOOK_MENUTOP /tools/smarty/sysplugins/smarty_internal_templatebase.php(157) : eval()'d code on line 206 Mon fichier header appel plusieurs hook : header, top, banner, menutop et leftcolumn ce qui est étrange c'est qu'il n'y en a qu'un seul qui fonctionne c'est le hook top qui est appelé comme suit : </script><div id="header_right">{$HOOK_TOP}</div> J'ai fait des recherches du coté des surcharges et testé pas mal de chose réglage dans le BO suppression de l'appel de hook menutop dans le fichier frontcontroller situé dans le dossier override/classe rien n'y fait. quelqu'un a une idée ? Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 liste des hooks de ta table ps_hook Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 ps_hook.pdf voici la table ps_hook Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 Resultat de: select m.*, h.*, hm.*, ha.*, ms.* from ps_module m left join ps_hook_module hm on hm.id_module = m.id_module left join ps_hook h on h.id_hook = hm.id_hook left join ps_hook_alias ha on ha.name = h.name left join ps_module_shop ms on ms.id_module = m.id_module where m.name like '%menu%' Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 Je n'ai pas bien saisi l'objet de cet requête mais lorsque je la copie/colle sur phpmyadmin j'ai un résultat vide Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 Quel est ne nom de ton module de menu? ajuste %menu% en conséquences Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 idem résultat vide Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 donc ton module n'est pas hooké... ce qui explique pourquoi il n'apparait pas Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 sorry en fait je me suis trompé j'ai mis le nom du hook au lieu du nom du module, en mettant bien le nom du module j'ai un retour qui est celui ci Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 et nous sommes d'accord que ce module efipeekcategory.php contient une fonction public function hookMenuTop(...) Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 (edited) Tout à fait voici pour que ce soit plus clair ce que contient le module public function install() { if (!parent::install() OR !$this->registerHook('menuTop')) return false; return true; } public function hookMenuTop($params){ return $this->hookLeftColumn($params); } d'ailleurs le module s'affiche bien dans le back office, j'ai l'impression que le problème vient de l'appel de hook me trompe-je ? j'ai regardé aussi du coté du frontcontroller mais je n'ai pas trouvé ce qui pouvait poser problème Edited May 10, 2017 by Shinobi80 (see edit history) Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 Donc si dans ton tpl tu écris {hook h='menuTop' mod='efipeekcategory'} la fonction devrait s'executer Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 Rien à faire elle ne s'execute pas, voici ce qu'il y a dans le fichier /override/classes/FrontController.php est-ce qu'il est correct selon toi ? class FrontController extends FrontControllerCore { public function displayHeader($nobots = false) { global $css_files, $js_files; if (!self::$initialized) $this->init(); // P3P Policies (http://www.w3.org/TR/2002/REC-P3P-20020416/#compact_policies) header('P3P: CP="IDC DSP COR CURa ADMa OUR IND PHY ONL COM STA"'); /* Hooks are volontary out the initialize array (need those variables already assigned) */ self::$smarty->assign(array( 'time' => time(), 'img_update_time' => Configuration::get('PS_IMG_UPDATE_TIME'), 'static_token' => Tools::getToken(false), 'token' => Tools::getToken(), 'logo_image_width' => Configuration::get('SHOP_LOGO_WIDTH'), 'logo_image_height' => Configuration::get('SHOP_LOGO_HEIGHT'), 'priceDisplayPrecision' => _PS_PRICE_DISPLAY_PRECISION_, 'content_only' => (int)Tools::getValue('content_only') )); self::$smarty->assign(array( 'HOOK_TOP' => Hook::exec('displayTop'), 'HOOK_BANNER' => Hook::exec('banner'), 'HOOK_LEFT_COLUMN' => Hook::exec('leftColumn'), 'HOOK_MENUTOP' => Hook::exec('menuTop'), 'HOOK_HEADER' => Hook::exec('header'), )); Link to comment Share on other sites More sharing options...
doekia Posted May 10, 2017 Share Posted May 10, 2017 et tu as réactivé tes overrides? et en écrivant la directive dans le tpl? PM moi Link to comment Share on other sites More sharing options...
shinobi80 Posted May 10, 2017 Author Share Posted May 10, 2017 J'ai bien été dans performance avancé et mis sur NON le menu désactiver toute les surchages Je te PM Link to comment Share on other sites More sharing options...
shinobi80 Posted May 11, 2017 Author Share Posted May 11, 2017 Un grand Merci à Doekia pour son expertise !! My problem is solved Le soucis venait du module en lui même. 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