ody Posted April 7, 2017 Share Posted April 7, 2017 Hello, I'm trying with a hook php order to redirect https://domain/cart.php?a=add&domain=register to default main page http://domain/domainchecker.php I'll try <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { $secondarySidebar->getChild('Actions') ->getChild('Domain_Registration') ->setUri('https://domain/domainchecker.php'); }); or <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('SecondarySidebar', 1, function(MenuItem $SecondarySidebar) { $SecondarySidebar->getChild('Actions') ->getChild('Domain_Registration') ->setUri('https://domain/domainchecker.php'); }); or <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('Secondary_Sidebar', 1, function(MenuItem $secondary_Sidebar) { $Secondary_Sidebar->getChild('Actions') ->getChild('DomainRegistration') ->setUri('https://Domain/domainchecker.php'); }); But .... Thank you in advance Ody 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted April 7, 2017 Share Posted April 7, 2017 I can see two points with this... 1. you'll need to check that the sidebar exists before trying to modify it... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar) { if (!is_null($secondarySidebar->getChild('Actions'))) { $secondarySidebar->getChild('Actions') ->getChild('Domain Registration') ->setUri('domainchecker.php'); } }); 2. if you're trying to use this on v7, then it's probably pointless - in v7, domainchecker.php is basically just a dummy file that redirects to "cart.php?a=add&domain=register"... so by changing the sidebar link to domainchecker, it's still going to redirect to the cart - that's how v7 works now. 0 Quote Link to comment Share on other sites More sharing options...
ody Posted April 7, 2017 Author Share Posted April 7, 2017 Solved !!! in a moment !!! & Works !!! as we still use 7.0.1 we haven't upgrade our version as when we do that "mess-mess-mess" WHMCS every week have a new release.... without many serious changes and most times bring more problems than to solve them. Thank you Brian, Brian The Best WHMCS Support Team All In ONE Person! If you ever Brian decide to open a WHMCS support site-service we and I believe some thousands other WHMCS users we shall follow you, as a client always, I prefer to pay a Brian support service than the original WHMCS support Service. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.