reymarcus Posted July 19, 2020 Share Posted July 19, 2020 (edited) Hello everyone. I need to do something with Prestashop, but i am not sure it can be done. I want to add a new item in the main menu. That item have to contain a subitem with a link to another page. For example, a menu item called "Externals" and its subitem called "Google", which takes you to Google if you click on it. I am working with the latest version of Prestashop, if that's relevant. I was looking at the ps_mainmenu module, but I couldn't find the place that generate the html to the main menu. Thank you for your time. Excuse me if it's a repeated post, but i couldn't find something similar. Edited July 19, 2020 by reymarcus (see edit history) Link to comment Share on other sites More sharing options...
reymarcus Posted July 19, 2020 Author Share Posted July 19, 2020 Hello again, i just figured out how to do this. Just need to go to modules\ps_mainmenu\ps_mainmenu.php and, in the function generatesCategoriesmenu, add a control for the subcategory where you want to put the link. In my case, the one with the id number 8 if ($category['level_depth'] > 1) { $cat = new Category($category['id_category']); if ((int)$cat ->id_category == 8 $link = "http://google.com/"; else $link = $cat->getLink(); } else { $link = $this->context->link->getPageLink('index'); } After that, you need to clean the cache. When you refresh the page, you should see the new link. Thank you anyways and i hope this post helps someone. 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