Jump to content

[Ask] Hooks on Client Area Switch Account Page


Mas-J

Recommended Posts

Hi, I want to show 2 value on the Client Area page when on the Switch Account Page next to the Client Name instead of Client Name only, I want add client email & company name too or something client custom field to identify the project name on that client as example.

image.thumb.png.84a3ee8695df8090d8642bb4dabb95de.png

I can do similar on admin area page on other case, because it have a value for the user ID to get any data from database.

 

But, on the Client Area Switch Account Page I can't find it

Variable Type Notes
companyname string  
logo string  
systemurl string  
charset string  
pagetitle string  
filename string  
template string  
language string  
LANG array Active language translation strings
todaysdate string Human friendly formatted version of todays date
date_day string Current day of the month
date_month string Current month
date_year string Current year
WEB_ROOT string The web path to the WHMCS doc root
BASE_PATH_CSS string  
BASE_PATH_JS string  
BASE_PATH_FONTS string  
BASE_PATH_IMG string  
token string CSRF token value
servedOverSsl bool True if page was loaded via https://

 

Here's the code that I write, I know it's not perfect because it not tested before

image.thumb.png.f820e1183bbd5a952582ee4e9efadef2.png

 

Is there any clue ?

Link to comment
Share on other sites

On 16/07/2021 at 05:47, Mas-J said:

But, on the Client Area Switch Account Page I can't find it

that's not a definitive list of available variables - they never are.

On 16/07/2021 at 05:47, Mas-J said:

Is there any clue ?

I can think of two options...

  1. get the $accounts array from the template, modify it by getting the email/companyname and then returning it to the database (a clientareapage hook to only work on this one page).... then modify the relevant template (user-switch-account) to output the required changes using the values in the updated array.
  2. get the array from the template, loop through it in a output hook and use JS to add the relevant content as required... your example hook could work if the user had only one client - but if that were the case, then the switch page wouldn't be shown and so the hook wouldn't run.
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.

  • 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