Guest vuzuggu Posted November 30, 2015 Share Posted November 30, 2015 I am trying to remove all signs of My Quotes from my WHMCS installation. I have them removed from the navbar by using the following code: $navItem = $primaryNavbar->getChild('Billing'); if (is_null($navItem)) { return; } else { $myquote = $navItem->getChild('My Quotes'); if (is_null($myquote)) { return; } else { $navItem->removeChild('My Quotes'); } } I am trying to remove the My Quotes link from the sidebar that displays on the pages: invoices Mass Payment My Quotes Manage Credit Card Add Funds Following the advice on http://docs.whmcs.com/Hooks:ClientAreaSidebars I have come up with the code below. However, it does not work. Am I making a silly mistake somewhere? <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $payment = $primarySidebar->getChild('Billing'); if (is_null($payment)) { return; } else { $quotes = $payment->getChild('Quotes'); if (!is_null($quotes)) { $payment->removeChild('Quotes'); } } }); 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted December 1, 2015 Share Posted December 1, 2015 Following the advice on http://docs.whmcs.com/Hooks:ClientAreaSidebars I have come up with the code below. However, it does not work. Am I making a silly mistake somewhere? probably by following the example code in the docs! the following should work... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Billing'))) { $secondarySidebar->getChild('Billing') ->removeChild('Quotes'); } }); btw - it's a secondary sidebar, not primary - so you were using the wrong hook anyway. 0 Quote Link to comment Share on other sites More sharing options...
Guest vuzuggu Posted December 1, 2015 Share Posted December 1, 2015 Spot on as always. Thanks! 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.