Jump to content

stuartoreilly

Member
  • Posts

    2
  • Joined

  • Last visited

Everything posted by stuartoreilly

  1. The sidebars are directly available in the ClientAreaPrimaryarySidebar and ClientAreaSecondarySidebar hooks. To add a sidebar to your addon module, either add the hooks in hooks.php in your module root, or add a php file in the whmcs/includes/hooks directory and deal with your menus there (I prefer this approach - keeping menu organisation and configuration separate from the module). <?php use WHMCS\View\Menu\Item as MenuItem; if (!defined("WHMCS")) { die("This file cannot be accessed directly"); } add_hook('ClientAreaSecondarySidebar', 1, function(MenuItem $secondarySidebar){ $module = $_GET['m']; switch ($module) { case 'customAddonModule': //Add new group to empty sidebar $panel = $secondarySidebar->addChild( 'Quick Links', [ 'label' => 'Quick Links', 'order' => 1, 'icon' => 'fas fa-shopping-cart', ] ); // Add individual links to group $panel->addChild('customAddonModule') ->setLabel('This Module') ->setIcon('fas fa-ticket') ->setUri('/index.php?m=customAddonModule') ->setClass('active') ->setOrder(1); $panel->addChild('things') ->setLabel('Buy Things') ->setIcon('fas fa-rabbit-in-headlights') ->setUri('/cart.php?gid=1') ->setOrder(2); $panel->addChild('stuff') ->setLabel('Configure Stuff') ->setIcon('fas fa-drunk-man-looking-for-keys') ->setUri('index.php?m=anotherModule') ->setOrder(3); break; case 'anotherModule' : //add another menu for another module } });
  2. The examples given in the api reference (developers.whmcs.com/api-reference/addproduct/) are incorrect. incorrect: 'pricing[2][annually]' => '80.00' correct: 'pricing' => [ 2 => ['annually' => '80.00']]
×
×
  • 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