Jump to content

Recommended Posts

Posted

Boa tarde pessoal, estou ainda começando no WHMCS.

Criei um hook para remover a opção de "Login to Webmail" dentro da área de cliente (imagem em anexo). Ele funciona e remove o menu, mas o hook está causando erro na página inicial onde o cliente se loga com o usuário e senha.

Acredito que falte alguma condição nesse código para apenas funcionar na area de cliente, mais especificamente onde há os detalhes do produto. Se algum puder ajudar agradeço

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar)
{
    $primarySidebar->getChild('Service Details Actions')
        ->removeChild('Login to Webmail');
});

hook_cliente_area.JPG


Posted

Consegui fazer funcionar... segue o código final

 

<?php

use WHMCS\View\Menu\Item as MenuItem;

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

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

if (!is_null($primarySidebar->getChild('Service Details Actions'))) {
            $primarySidebar->getChild('Service Details Actions')
                           ->removeChild('Login to cPanel');
   
            $primarySidebar->getChild('Service Details Actions')
                           ->removeChild('Login to Webmail');
   
   }
   
   
   
});

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Do you agree with our terms?

-