Jump to content

Custom page with logged in customer - WHMCS

Recommended Posts

I created a custom page by adding in the WHMCS root assistenza-clienti.php with this code:


use WHMCS\ClientArea;

define('CLIENTAREA', true);

require __DIR__ . '/init.php';

$ca = new ClientArea();
$ca->setPageTitle('Assistenza clienti');

# Define the template filename to be used without the .tpl extension


I created a custom page assistenza-clienti.tpl in the root of my custom template.

The page works but when the client logging in the header dosen't see that the client is still logged in.

An Example as shown into attached image.

Please Help Me


Link to comment
Share on other sites

Sorry this is not good, the page should be seen even if you are not logged in.

But if logged it must show the menu as in the image.
It is very strange, even if I am logged in as a customer if I visit, for example, the main page (home) and the other default pages, these show the menu as in the picture.

As soon as I go to the custom Assistenza Clienti page, I show the menu as if I am not logged in.

But in reality they are.

Link to comment
Share on other sites


I've added this code into assistenza-clienti.php but into primary menu dasen't show the first name.

// Check login status
if ($ca->isLoggedIn()) {

     * User is logged in - put any code you like here
     * Here's an example to get the currently logged in clients first name

    $clientName = Capsule::table('tblclients')
        ->where('id', '=', $ca->getUserID())->pluck('firstname');
        // 'pluck' was renamed within WHMCS 7.0.  Replace it with 'value' instead.
        // ->where('id', '=', $ca->getUserID())->value('firstname');
    $ca->assign('clientname', $clientName);

} else {

    // User is not logged in
    $ca->assign('clientname', 'Random User');



Senza titolo-1.jpg

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.

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

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated