JohanBek Posted November 14, 2012 Share Posted November 14, 2012 Bonjour, Je suis novice sous PrestaSHop 1.5 et je tente de créer une boutique. J'essaie de déplacer le menu haut dans un nouveau hook que j'ai créé. Le menu apparait bien dans mon nouveau hook, mais les fichiers externes (css, js) ne sont pas chargés... J'ai pourtant dupliqué la fonction hookDisplayTop : public function hookDisplayTop($param) { $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); $this->page_name = Dispatcher::getInstance()->getController(); $smarty_cache_id = 'blocktopmenu-'.$this->page_name.'-'.(int)$this->context->shop->id.'-'.implode(', ',$this->user_groups).'-'.(int)$this->context->language->id.'-'.(int)Tools::getValue('id_category').'-'.(int)Tools::getValue('id_manufacturer').'-'.(int)Tools::getValue('id_supplier').'-'.(int)Tools::getValue('id_cms').'-'.(int)Tools::getValue('id_product'); $this->context->smarty->cache_lifetime = 31536000; Tools::enableCache(); if (!$this->isCached('blocktopmenu.tpl', $smarty_cache_id)) { $this->makeMenu(); $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH')); $this->smarty->assign('MENU', $this->_menu); $this->smarty->assign('this_path', $this->_path); } $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); $html = $this->display(__FILE__, 'blocktopmenu.tpl', $smarty_cache_id); Tools::restoreCacheSettings(); return $html; } avec mon nom de hook : public function hookHeaderCategories($param) { $this->user_groups = ($this->context->customer->isLogged() ? $this->context->customer->getGroups() : array(Configuration::get('PS_UNIDENTIFIED_GROUP'))); $this->page_name = Dispatcher::getInstance()->getController(); $smarty_cache_id = 'blocktopmenu-'.$this->page_name.'-'.(int)$this->context->shop->id.'-'.implode(', ',$this->user_groups).'-'.(int)$this->context->language->id.'-'.(int)Tools::getValue('id_category').'-'.(int)Tools::getValue('id_manufacturer').'-'.(int)Tools::getValue('id_supplier').'-'.(int)Tools::getValue('id_cms').'-'.(int)Tools::getValue('id_product'); $this->context->smarty->cache_lifetime = 31536000; Tools::enableCache(); if (!$this->isCached('blocktopmenu.tpl', $smarty_cache_id)) { $this->makeMenu(); $this->smarty->assign('MENU_SEARCH', Configuration::get('MOD_BLOCKTOPMENU_SEARCH')); $this->smarty->assign('MENU', $this->_menu); $this->smarty->assign('this_path', $this->_path); } $this->context->controller->addJS($this->_path.'js/hoverIntent.js'); $this->context->controller->addJS($this->_path.'js/superfish-modified.js'); $this->context->controller->addCSS($this->_path.'css/superfish-modified.css'); $html = $this->display(__FILE__, 'blocktopmenu.tpl', $smarty_cache_id); Tools::restoreCacheSettings(); return $html; } Mais pas de CSS, je suis un peu perdu... 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