Jump to content

Removing My Quotes


Guest vuzuggu

Recommended Posts

Guest vuzuggu

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

});

Link to comment
Share on other sites

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.

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