Jump to content

change menu link


omega0011

Recommended Posts

Hi, in the client area I want to change the link of Open Ticket to another link. I also want to change the Tickets under the Support drop down menu to the same link. I got this code from a suppor ticket

 

<?php

 

use WHMCS\View\Menu\Item as MenuItem;

 

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)

{

$navItem = $navItem->getChild('Open Ticket');

if (is_null($navItem)) {

return;

}

 

$navItem->setUri('https://www.mydomain.com');

 

});

 

I named the file hooks.php and put it in whmcs/includes/hooks but I get a 500 error message.

What am I doing wrong and what is the code for the Tickets under the Support drop down menu?

I am new to all this, thank you.

Link to comment
Share on other sites

it should work this way

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
$navItem = $primaryNavbar->getChild('Open Ticket');
if (is_null($navItem)) {
return;
}

$navItem->setUri('https://www.mydomain.com');

});

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