Jump to content

Remove Categories from sidebar


Recommended Posts

Hello, 

I purchased WHMCS 2 days ago and Im having a really hard time customising it as most of the hooks used in the past don't work anymore so most of the previous posts on forums etc are a bit useless. 

I want to remove "Categories" from secondary sidebar, I found this but it doesnt work.... 

I appreciate your help in advance! I added this to includes/hooks/chsidebar.php

 

http://creativeherhosting.com/hosting/cart.php?a=confproduct&i=1

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $SecondarySidebar)
{
   if(!is_null($SecondarySidebar->getChild('Categories'))){
               $SecondarySidebar->removeChild('Categories');
   }
}); 

?>
 

Link to comment
Share on other sites

On 18/07/2020 at 13:11, Dominika said:

I want to remove "Categories" from secondary sidebar, I found this but it doesnt work.... 

your code works for me...

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $SecondarySidebar) {
	
	if (!is_null($SecondarySidebar->getChild('Categories'))){
		$SecondarySidebar->removeChild('Categories');
	}
});

5y5qkOG.png

Link to comment
Share on other sites

  • WHMCS Technical Analyst II

I can verify that the provided code works on my test installs as well. If it does not work on yours, despite putting it in a PHP file in the /includes/hooks folder as described, please ensure that your website isn't behind a caching service that is unexpected caching the HTML output of PHP pages and may be causing this as a result.

If that doesn't help or apply, please feel free to reach out to our support team via https://www.whmcs.com/submit-a-ticket/ and we can investigate this further.

Link to comment
Share on other sites

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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