guillaume2vo Posted September 24, 2015 Share Posted September 24, 2015 Bonjour, J'ai besoin de mettre le sous menu a un niveau donc, j'ai trouvé un tutoriel sur le net que j'ai mis en application, or il ne fonctionne pas. protected function generateCategoriesMenu($categories, $is_children = 0) { $html = ''; foreach ($categories as $key => $category) { if ($category['level_depth'] > 3) return false { $cat = new Category($category['id_category']); $link = Tools::HtmlEntitiesUTF8($cat->getLink()); } else { $link = $this->context->link->getPageLink('index'); } cela m'indique que j'ai le else en trop, donc, je fait. protected function generateCategoriesMenu($categories, $is_children = 0) { $html = ''; foreach ($categories as $key => $category) { if ($category['level_depth'] > 3) return false { $cat = new Category($category['id_category']); $link = Tools::HtmlEntitiesUTF8($cat->getLink()); et cela ne fonctionne toujours pas. Comment, je peux faire ? Link to comment Share on other sites More sharing options...
Bakhouche Akram Posted September 24, 2015 Share Posted September 24, 2015 (edited) protected function generateCategoriesMenu($categories, $is_children = 0) { $html = ''; foreach ($categories as $key => $category) { if ($category['level_depth'] > 3) return false { $cat = new Category($category['id_category']); $link = Tools::HtmlEntitiesUTF8($cat->getLink()); et cela ne fonctionne toujours pas. Comment, je peux faire ? foreach ($categories as $key => $category) { if ($category['level_depth'] > 3) { $cat = new Category($category['id_category']); $link = Tools::HtmlEntitiesUTF8($cat->getLink()); } else { $link = $this->context->link->getPageLink('index'); } } Edited September 24, 2015 by Bakhouche Akram (see edit history) 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