Hi,
I'm trying to remove and add some menu items to the WHMCS template through hooks. I was able to add some but following same php files, for some reason, some did not work.
Can someone advise what is wrong with these hook php files?
1-Adding "VPN" as submenu of "Hosting Main Menu"
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
if (!is_null($primaryNavbar->getChild('Hosting'))) {
$primaryNavbar->getChild('Hosting')
->addChild('VPN', array(
'label' => 'VPN',
'uri' => 'https://.......',
'order' => '101',
));
}
});
2-Remove "SSL Certificates" from submenu under "Store"
<?php
use WHMCS\View\Menu\Item as MenuItem;
add_hook('ClientAreaPrimaryNavbar', 1, function (MenuItem $primaryNavbar)
{
if (!is_null($primaryNavbar->getChild('Store'))) {
$primaryNavbar->getChild('Store')->removeChild('SSL Certificates');
}
});
Please advise