Syed Ans Shah Posted August 25, 2019 Share Posted August 25, 2019 Hi everyone, i am using hostiko-light template and whmcs v7.7.1, i want to remove/hide some tabs and panels from whmcs client area. 1. i want to remove the Action tab / Panel. 2. i want to add/remove some tabs/option in the client area menu. can you please guide me how to do these changes? it is urgent. thanks 🙂 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 25, 2019 Share Posted August 25, 2019 5 hours ago, Syed Ans Shah said: 1. i want to remove the Action tab / Panel. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } }); 5 hours ago, Syed Ans Shah said: 2. i want to add/remove some tabs/option in the client area menu. <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } }); 2 Quote Link to comment Share on other sites More sharing options...
Syed Ans Shah Posted August 26, 2019 Author Share Posted August 26, 2019 thanks @brian! you are always helpful , both worked fine 🙂 0 Quote Link to comment Share on other sites More sharing options...
sokalsondha Posted April 5, 2020 Share Posted April 5, 2020 On 8/25/2019 at 5:02 PM, brian! said: <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } }); <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } }); hello brian thanks you for this code i put this and its work for me to but i want to remove some of other buttons from the menu too and i already remove those buttons <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Edit Account Details') ->removeChild('Security Settings') ->removeChild('Contacts/Sub-Accounts'); } }); so using the same hook file can you please help me to remove some more button Services -->>> Order New Services & View Available Addons Billing --->>>>> My Quotes d i would like to use only one hook file for the whole client area if its possible or i need to modify the template file? hope i am able to explain you... Thanks again brian for all the time help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 5, 2020 Share Posted April 5, 2020 7 hours ago, sokalsondha said: i would like to use only one hook file for the whole client area if its possible or i need to modify the template file? you can do most of it in one file - so if I merge all the hooks on this page into one file, we get... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Services'))) { $primaryNavbar->getChild('Services') ->removeChild('Services Divider') ->removeChild('Order New Services') ->removeChild('View Available Addons'); } if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing') ->removeChild('My Quotes'); } }); add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Edit Account Details') ->removeChild('Security Settings') ->removeChild('Contacts/Sub-Accounts'); } }); add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setFooterHtml(''); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->removeChild('Client Shortcuts'); } if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } }); take care not to still have any other active hook files trying to remove the same elements... removing the tile on the client area homepage is usually done by editing the clientareahome.tpl template - if you just wanted to remove any (or all) of them, then you can do that with css... .tile:nth-child(2) {display: none;} ... but that will leave a space at the end... I assume from your screenshot, that you don't sell domains - and that second tile normally gives the total for domains, failing that affiliate total or as a last resort, quotes... if you're going to edit the template, then you can either remove that second tile and adjust the width of the other three... <div class="tiles clearfix"> <div class="row"> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=services'"> <a href="clientarea.php?action=services"> <div class="icon"><i class="fas fa-cube"></i></div> <div class="stat">{$clientsstats.productsnumactive}</div> <div class="title">{$LANG.navservices}</div> <div class="highlight bg-color-blue"></div> </a> </div> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='supporttickets.php'"> <a href="supporttickets.php"> <div class="icon"><i class="fas fa-comments"></i></div> <div class="stat">{$clientsstats.numactivetickets}</div> <div class="title">{$LANG.navtickets}</div> <div class="highlight bg-color-red"></div> </a> </div> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=invoices'"> <a href="clientarea.php?action=invoices"> <div class="icon"><i class="fas fa-credit-card"></i></div> <div class="stat">{$clientsstats.numunpaidinvoices}</div> <div class="title">{$LANG.navinvoices}</div> <div class="highlight bg-color-gold"></div> </a> </div> </div> </div> or you just replace the second tile with something else more relevant to your install. you can even increase the number of tiles if you want to (and have something to put in them!), but that would have layout consequences for non-English languages (where the translations are longer than one line of text)... I think there would be a scenario where you could remove and adjust the other tiles with jQuery, but it really would be easier to just edit the template. 🙂 0 Quote Link to comment Share on other sites More sharing options...
sokalsondha Posted April 5, 2020 Share Posted April 5, 2020 (edited) 6 hours ago, brian! said: you can do most of it in one file - so if I merge all the hooks on this page into one file, we get... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Services'))) { $primaryNavbar->getChild('Services') ->removeChild('Services Divider') ->removeChild('Order New Services') ->removeChild('View Available Addons'); } if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing') ->removeChild('My Quotes'); } }); add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Edit Account Details') ->removeChild('Security Settings') ->removeChild('Contacts/Sub-Accounts'); } }); add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setFooterHtml(''); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->removeChild('Client Shortcuts'); } if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } }); take care not to still have any other active hook files trying to remove the same elements... removing the tile on the client area homepage is usually done by editing the clientareahome.tpl template - if you just wanted to remove any (or all) of them, then you can do that with css... .tile:nth-child(2) {display: none;} ... but that will leave a space at the end... I assume from your screenshot, that you don't sell domains - and that second tile normally gives the total for domains, failing that affiliate total or as a last resort, quotes... if you're going to edit the template, then you can either remove that second tile and adjust the width of the other three... <div class="tiles clearfix"> <div class="row"> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=services'"> <a href="clientarea.php?action=services"> <div class="icon"><i class="fas fa-cube"></i></div> <div class="stat">{$clientsstats.productsnumactive}</div> <div class="title">{$LANG.navservices}</div> <div class="highlight bg-color-blue"></div> </a> </div> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='supporttickets.php'"> <a href="supporttickets.php"> <div class="icon"><i class="fas fa-comments"></i></div> <div class="stat">{$clientsstats.numactivetickets}</div> <div class="title">{$LANG.navtickets}</div> <div class="highlight bg-color-red"></div> </a> </div> <div class="col-sm-4 col-xs-6 tile" onclick="window.location='clientarea.php?action=invoices'"> <a href="clientarea.php?action=invoices"> <div class="icon"><i class="fas fa-credit-card"></i></div> <div class="stat">{$clientsstats.numunpaidinvoices}</div> <div class="title">{$LANG.navinvoices}</div> <div class="highlight bg-color-gold"></div> </a> </div> </div> </div> or you just replace the second tile with something else more relevant to your install. you can even increase the number of tiles if you want to (and have something to put in them!), but that would have layout consequences for non-English languages (where the translations are longer than one line of text)... I think there would be a scenario where you could remove and adjust the other tiles with jQuery, but it really would be easier to just edit the template. 🙂 Dear Brian.. I dont know how to say thank you.. its works like a dream. you are right we dont sell domains as this whmcs set up for ISP only broadband so and we will not allow customer will place an order from website. as all will be manual order from admin side can you please help me to remove this action button from the left side as client can see and click add new product which we dont want this.. hopefully you will able to help me this thing as well and brian i just post this thing. will you able to reply me on this. please sir Kind Regards Mahim Edited April 5, 2020 by sokalsondha 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 6, 2020 Share Posted April 6, 2020 Hi Mahim, 18 hours ago, sokalsondha said: can you please help me to remove this action button from the left side <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar) { if (!is_null($primaryNavbar->getChild('Services'))) { $primaryNavbar->getChild('Services') ->removeChild('Services Divider') ->removeChild('Order New Services') ->removeChild('View Available Addons'); } if (!is_null($primaryNavbar->getChild('Billing'))) { $primaryNavbar->getChild('Billing') ->removeChild('My Quotes'); } }); add_hook('ClientAreaSecondaryNavbar', 1, function (MenuItem $secondaryNavbar) { if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Change Password'); } if (!is_null($secondaryNavbar->getChild('Account'))) { $secondaryNavbar->getChild('Account') ->removeChild('Edit Account Details') ->removeChild('Security Settings') ->removeChild('Contacts/Sub-Accounts'); } }); add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('Service Details Actions'))) { $primarySidebar->removeChild('Service Details Actions'); } if (!is_null($primarySidebar->getChild('Client Details'))) { $primarySidebar->getChild('Client Details') ->setFooterHtml(''); } }); add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Client Shortcuts'))) { $secondarySidebar->removeChild('Client Shortcuts'); } if (!is_null($secondarySidebar->getChild('Client Contacts'))) { $secondarySidebar->removeChild('Client Contacts'); } if (!is_null($secondarySidebar->getChild('My Services Actions'))) { $secondarySidebar->removeChild('My Services Actions'); } }); only that final IF statement is new - the rest is as before. 18 hours ago, sokalsondha said: i just post this thing. will you able to reply me on this. i'll take a look. 0 Quote Link to comment Share on other sites More sharing options...
massa Posted July 26, 2020 Share Posted July 26, 2020 (edited) Hi, I would like to remove one configurable option and just from client panel. Can you please tell me how to do that? Thanks! Edited July 26, 2020 by massa wrong image 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.