Lex3891 Posted July 15, 2019 Share Posted July 15, 2019 As title. I've currently managed to change the Store menu links with the following. I'm trying make the category pages direct to an external as well, but struggling to find anything on a search or through playing about. Anyone know of anything I can add to this to make it change them as well? Many advanced thanks. 🙂 add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { $navItem = $primaryNavbar->getChild('Home'); if (is_null($navItem)) { return; } $navItem->setUri('/billing/clientarea.php'); $navItem->setlabel('My Account'); $navItem->setIcon('far fa-user'); $navItem1 = $primaryNavbar->getChild('Store'); if (is_null($navItem1)) { return; } $navItem1 = $navItem1->getChild('Web Builder Hosting'); if (is_null($navItem1)) { return; } $navItem1->setUri('/web-builder-hosting'); $navItem2 = $primaryNavbar->getChild('Store'); if (is_null($navItem1)) { return; } $navItem2 = $navItem2->getChild('Linux Hosting'); if (is_null($navItem2)) { return; } $navItem2->setUri('/linux-hosting'); if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->getChild('Store')->removeChild('Browse Products Services'); } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 16, 2019 Share Posted July 16, 2019 22 hours ago, Lex3891 said: As title. I've currently managed to change the Store menu links with the following. a slightly unusual way to have done it - i'd have taken the following route... you could even use it to add icons to those links too. btw - I doubt you would need the path /billing/ in that replacement home URL. 22 hours ago, Lex3891 said: I'm trying make the category pages direct to an external as well, but struggling to find anything on a search or through playing about. to be honest, you could just duplicate the hook from the above thread, change "ClientAreaPrimaryNavbar" to "ClientAreaSecondarySidebar", replace references of $primarynavbar with $secondarysidebar, change 'Store' to 'Categories' and it would work on the sidebar too. 🙂 although if you only have two links to change in your sidebar, then that hook might be overkill and you could easily just write a hook to replace those two non-MC group links. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.