Jump to content

How hide client details sidebar in client area?


xelatirdan

Recommended Posts

Hello!

 

Can you help me with hide "Client details" block in clientarea. (i.imgur.com/szrmpcv.png)

I've found one way, but it is bad way:

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

   add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) 
       {
           $client = Menu::context('client');

               $address_new = $client->fullname;

       if (!is_null($primarySidebar->getChild('Client Details'))) {
                   $primarySidebar->removeChild('Client Details')
                                   ->addChild('Client Details')
                                   ->moveToFront()
                                   ->addChild($address_new);
       }
});

 

- - - Updated - - -

 

Sorry for bad link, new screenshoot: i.imgur.com/YL7GFQF.png

Link to comment
Share on other sites

you should remove it using an action hook - create a file in includes/hooks and called it removeinfosidebar.php and add the following code to it...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

   add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) 
       {
       if (!is_null($primarySidebar->getChild('Client Details'))) {
                   $primarySidebar->removeChild('Client Details');                
       }
});

when you refresh the page where the sidebar was, it should now be gone.

Link to comment
Share on other sites

you should remove it using an action hook - create a file in includes/hooks and called it removeinfosidebar.php and add the following code to it...

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

   add_hook('ClientAreaPrimarySidebar', 1, function (MenuItem $primarySidebar) 
       {
       if (!is_null($primarySidebar->getChild('Client Details'))) {
                   $primarySidebar->removeChild('Client Details');                
       }
});

when you refresh the page where the sidebar was, it should now be gone.

 

Thank you it is work, but I try this hook later and he doesn't work maybe I used wrong syntax. Many thaks!

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