Jump to content

how to remove Tab/Panel from client Area


Recommended Posts

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 🙂

 

 

hide remove tabpanel.PNG

Link to comment
Share on other sites

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');
	}
});

 

Link to comment
Share on other sites

  • 7 months later...
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

image.thumb.png.2322013943aef24d6c013df92d5b8c7d.png

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

 

Link to comment
Share on other sites

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...

PIojlgL.png

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>

cjukRxu.png

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)...

KRIULK1.png

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. 🙂

Link to comment
Share on other sites

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...

PIojlgL.png

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>

cjukRxu.png

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)...

KRIULK1.png

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

image.png

Edited by sokalsondha
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated