Jump to content
Sign in to follow this  
stevelack

Removing Action Sidebar Menu from My Products and Services page.

Recommended Posts

I am trying to remove the sidebar menu "Actions" from the My Products and Services page.  I have created the following hook:

```
<?php

use WHMCS\View\Menu\Item as MenuItem;

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

});
```
But it is not removing the sidebar from the page /clientarea.php?action=services
What am I doing wrong?

Thanks,

Steve

Share this post


Link to post
Share on other sites

Hi Steve,

On 21/06/2020 at 04:44, stevelack said:

What am I doing wrong?

the only issue with the code is that the Services Actions sidebar is a secondary sidebar and not a primary one... therefore, all you should need to do is change all references to "Primary" and "primary" to "Secondary" and "secondary". 🙂

Share this post


Link to post
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.

Sign in to follow this  

  • Similar Content

    • By Danse
      Hi, does anyone has a Hook which auto enables the DNS of new Domains in WHMCS? 
      Customers always complaining that DNS Management is missing and i have to switch that on, all the Time. 
      And i wont take this as upselling position. So activate DNS Management in Frontend for "0$" is aswell not suitable for me. 
      It just be there and done 🙂
      Any Suggestions, or Code Templates? 
    • By hosthuski
      Hello all. I am hoping you can help me do what I think should be simple for people who have dealt with hooks already.
      I want to do this:
      IF a product's ID = x (I imagine this involves getting the product ID from a variable and doing an IF statement in PHP)
      THEN 
      get the service_domain field (built-in field, not custom field),
      run a shell script while passing the domain field as a bash variable to be used within the script's execution.
      Why do I want to do this?
      This will allow me to begin the process of provisioning maintenance coverage via WP CLI for customers who order a maintenance plan from us.
      I'll create an additional 2 hooks -- three total so one for each maintenance plan. If I can get the first hook, i can make the others and likely merge them together. I just need a "template" to follow from someone who understands PHP more than on the surface like I do. This ultimately will chain 3 of my servers together. WHMCS server, our cPanel server, and the maintenance server.
      Any help is appreciated. Would anyone be willing to paste in an effective code sample that I can use?
    • By Dreza
      Hello,
      I created a hook file for the 'OrderPaid' event and it seems like the $vars variable that is being passed to it always comes up empty. Does anyone know why this is happening?
    • By Dreza
      Hello,
      I created a hook file for one of my addon modules and it seems like the hook event is always happening. The hook event is 'OrderPaid'.
      When I look at the module logs there is an entry for this hook event every minute even though no orders have been paid for during this time.
      I need to know why this is happening. If anyone can help me I would appreciate it.
    • By GagalKoding
      Hi there,
      I have returned $vars from EmailPreSend Hooks like this
      Array ( [messagename] => Other Product/Service Welcome Email [relid] => 805 [mergefields] => Array ( [service_first_payment_amount] => WHMCS\View\Formatter\Price Object ( [price:protected] => 350000 [currency:protected] => Array ( [id] => 1 [code] => IDR [prefix] => Rp [suffix] => IDR [format] => 3 [rate] => 1.00000 ) [defaultFormat:protected] => {PREFIX}{PRICE}{SUFFIX} [defaultCurrencyDescriptor:protected] => Array ( [format] => 1 [prefix] => [suffix] => ) ) How to print "350000" on price protected object from ['mergefields']['service_first_payment_amount']
      I try $vars['mergefields']['service_first_payment_amount']->price;
      But i get message Error: Cannot access protected property WHMCS\View\Formatter\Price::$price
  • 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