Nikko Posted June 25, 2017 Share Posted June 25, 2017 Dear members, my hook "removeStore" <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->removeChild('Store'); } }); should only works, if the template is "six". On custom template "sixcustom" the hook should not work. I have a second hook from the forum, which ask the active template: <?php function hook_getTemplateName($vars){ global $CONFIG; if (isset($_SESSION['Template'])){ $template = $_SESSION['Template']; } else { $template = $CONFIG['Template']; } } add_hook("ClientAreaPage", 1, "hook_getTemplateName"); But.... How can I put both together... and make it, that my hook "removeStore" only works on six template? Many thanks!!! 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted June 25, 2017 Share Posted June 25, 2017 it's as easy as copy and paste <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { global $CONFIG; if (isset($_SESSION['Template'])){ $template = $_SESSION['Template']; } else { $template = $CONFIG['Template']; } if ($template=="six"){ // Add your logic here if (!is_null($primaryNavbar->getChild('Store'))) { $primaryNavbar->removeChild('Store'); } } }); 0 Quote Link to comment Share on other sites More sharing options...
Nikko Posted June 25, 2017 Author Share Posted June 25, 2017 If you know, how. :-) Many thanks!!! It works fine! 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.