Tom Wilson Posted August 25, 2019 Share Posted August 25, 2019 Hello I know this is possible through hooks but I'm not sure how exactly! In the client area within the domain details page: I want to add an option under 'Manage' which will link to another page - how do I do this? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 25, 2019 Share Posted August 25, 2019 4 hours ago, Tom Wilson said: I want to add an option under 'Manage' which will link to another page - how do I do this? as a rough starting point... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $DomainDetails = $primarySidebar->getChild("Domain Details Management"); if (empty($DomainDetails)) { return; } $DomainDetails->addChild('new link 5', array( 'label' => '*My Label*', 'uri' => 'custompage.php', 'order' => '100', )); }); you could use Lang::trans on the label if it needs to be multilingual and you want to create the language strings for it; the 'order' value will determine where it is located on the sidebar (lower values towards the top, higher values towards the bottom); and 'uri' contains the page that you want the child to link to. 1 Quote Link to comment Share on other sites More sharing options...
Tom Wilson Posted August 26, 2019 Author Share Posted August 26, 2019 On 25/08/2019 at 5:02 PM, brian! said: as a rough starting point... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $DomainDetails = $primarySidebar->getChild("Domain Details Management"); if (empty($DomainDetails)) { return; } $DomainDetails->addChild('new link 5', array( 'label' => '*My Label*', 'uri' => 'custompage.php', 'order' => '100', )); }); you could use Lang::trans on the label if it needs to be multilingual and you want to create the language strings for it; the 'order' value will determine where it is located on the sidebar (lower values towards the top, higher values towards the bottom); and 'uri' contains the page that you want the child to link to. Thanks! How about a page for a web hosting product too? On this one, I would like to not only add one, but remove one too, I am wanting to remove the 'Request Cancellation' and 'Upgrade/Downgrade Options'. 0 Quote Link to comment Share on other sites More sharing options...
zitu4life Posted August 26, 2019 Share Posted August 26, 2019 6 minutes ago, Tom Wilson said: How about a page for a web hosting product too? On this one, I would like to not only add one, but remove one too, I am wanting to remove the 'Request Cancellation' and 'Upgrade/Downgrade Options'. Hello Setup>General Settings>other There is an option built in to disable cancellation. try and see if it works, regarding upgrade and downgrade, i cant remember... 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 26, 2019 Share Posted August 26, 2019 11 minutes ago, Tom Wilson said: How about a page for a web hosting product too? 11 minutes ago, Tom Wilson said: On this one, I would like to not only add one, but remove one too, I am wanting to remove the 'Request Cancellation' and 'Upgrade/Downgrade Options'. $kidsToIcon = array("Upgrade/Downgrade","Cancel"); 1 minute ago, zitu4life said: regarding upgrade and downgrade, i cant remember... it's in the product setup for each product.. setup -> product/services -> product/services -> *choose product* -> upgrades -> untick Configurable Options checkbox. if you're wanting to remove both cancellation and config upgrades on all products, then you can use either method... if you want to remove them for specific products, then you'll need the hook. and with regards to adding a child.. $ActionDetails->addChild('new link 6', array( 'label' => '*My Label*', 'uri' => 'custompage.php', 'order' => '100', )); 1 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.