Jump to content

Adding Links to menu


Kianzo

Recommended Posts

I found this topic

 

https://whmcs.community/topic/283057-adding-links-to-shortcut-area/

which is so awesome and allows to create a link to the wp-admin of the client domain

 

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{

$service = Menu::context('service');    
$domain = $service->domain;
$servertype = $service->product->servertype;

# Not cPanel, no links added
   if ($servertype!="cpanel"){
       return;
   }

   if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
			->addChild('wplink', array(
			'label' => 'Link To WordPress',
			'uri' => 'https://'.$domain.'/wp-admin',
			'order' => 200,
			));
   }
});

 

BUT  how to do it if the client has more than one domain?

let's say that my client has 5 domains and each domain has it's own WordPress install

so how  to add all of them to the navbar menu as a sub menu?

 

PS: all customers have domains registered with GoDaddy. I host WordPress websites for them only.

Thank you ♥

Link to comment
Share on other sites

On 09/02/2021 at 10:34, Kianzo said:

BUT  how to do it if the client has more than one domain?

let's say that my client has 5 domains and each domain has it's own WordPress install

so how  to add all of them to the navbar menu as a sub menu?

does each WP install have it's own unique product service within WHMCS ? e.g if the client has 5 WP installs, has he ordered 5 services from you and each separately listed in product/services area ?

Link to comment
Share on other sites

22 minutes ago, brian! said:

does each WP install have it's own unique product service within WHMCS ? e.g if the client has 5 WP installs, has he ordered 5 services from you and each separately listed in product/services area ?

Let's say the client took a one hosting plan and he installed the 5 WP from the cPanel. one click install.

btw how to make a unique product for each WP install within WHMCS? is there a module to do it or what? sounds amazing because I want to serve WP packages only.

 

sorry for asking alot, I'm learning. Thank you again.

Link to comment
Share on other sites

21 hours ago, Kianzo said:

Let's say the client took a one hosting plan and he installed the 5 WP from the cPanel. one click install.

are the 5 domains listed in the WHMCS database somewhere ?

23 hours ago, Kianzo said:

btw how to make a unique product for each WP install within WHMCS? is there a module to do it or what? sounds amazing because I want to serve WP packages only.

i'm not sure you can... well you could make a dummy product I suppose, but there's little point in that.

I know you could use the softaculous addon to add WP automatically when the account is created, but i'm not sure you want to do that.

https://www.softaculous.com/docs/developers/whmcs-auto-install-module/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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