If you need to rearrange the "Store" menu in WHMCS, directing single items on custom pages instead of cart grid, you can do it by mean of this hook

(TIP: keep all your navigation hooks, involving in menu management, in a single .php file!!!! Having many different files for hooks which do the same may be cause of a lot of mess!!!)

 

# Change Store Navbar Links Hook

# Written by brian!

use WHMCS\View\Menu\Item as MenuItem;

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

{

$Store = $primaryNavbar->getChild("Store");

if (empty($Store)) {

return;

}

$StoreChildren = $Store->getChildren();

$kidslinks = array("Web Hosting", "VPS Servers");

foreach($StoreChildren as $key => $Store_details_child) {

if (in_array($key, $kidslinks)) {

if ($key === "Web Hosting"){$newlink = "webhosting.php";}

elseif ($key === "VPS Servers"){$newlink = "vps.php";}

$Store->getChild($key)->setUri($newlink);

}

}

});

    

(credit to brian!)

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • WHMCS
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

 How to add a favicon in WHMCS

To add a favicon to your WHMCS install: copy your favicon (es. myfavicon.ico) in WHMCS folder...

 How to comment in template (.tpl) files

If you need to insert a comment in a .tpl file, or comment a block of code to disable it, you...

 How to insert a Youtube video in WHMCS knowledgebase article

To insert a YouTube video in an article of the WHMCS knowledge base, you need to insert following...

 How to disable a customer to pay invoices partly with credit balance

in WHMCS if a customer has not enough credit balance for full payment of an invoice, WHMCS allows...

 How to add a cookie bar to WHMCS

In order to add a cookie bar to your own installation of WHMCS: copy somewhere on your WHMCS...