daninapoli Posted March 7, 2022 Share Posted March 7, 2022 Hello everyone, I wanted to know if it was possible to set the main menu to display only one subcategory. eg: Now Clothing -> Shoes -> Boots, etc. etc. what I would like: Clothing -> Shoes then stop it at the second level. Link to comment Share on other sites More sharing options...
ComGrafPL Posted March 7, 2022 Share Posted March 7, 2022 Search for ps_categorytree ( Category tree links ) in modules. Change the depth to 2 and after clear cache, check it. Link to comment Share on other sites More sharing options...
daninapoli Posted March 7, 2022 Author Share Posted March 7, 2022 it is not the category tree but the main menu Link to comment Share on other sites More sharing options...
ComGrafPL Posted March 7, 2022 Share Posted March 7, 2022 5 minutes ago, daninapoli said: it is not the category tree but the main menu try with https://stackoverflow.com/questions/45160264/main-menu-level-depth either If you haven't already. 1 Link to comment Share on other sites More sharing options...
daninapoli Posted March 7, 2022 Author Share Posted March 7, 2022 (edited) I tried but failed ..... try again this is ?: foreach ($categories as $key => $category) { $node = $this->makeNode([]); if ($category['level_depth'] > 3) { $cat = new Category($category['id_category']); $link = $cat->getLink(); // Check if customer is set and check access if (Validate::isLoadedObject($this->context->customer) && !$cat->checkAccess($this->context->customer->id)) { continue; } } else { $link = $this->context->link->getPageLink('index'); } Edited March 7, 2022 by daninapoli (see edit history) Link to comment Share on other sites More sharing options...
daninapoli Posted March 8, 2022 Author Share Posted March 8, 2022 I tried to change but you can't see + anything can you help me? Link to comment Share on other sites More sharing options...
Xymor Posted January 22, 2024 Share Posted January 22, 2024 Thanks, it works on ps 8.1.2 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