SaneChoiceLtd Posted March 29, 2022 Share Posted March 29, 2022 Hi All, I am driving myself mad with this, so time to call in people with bigger brains than I! I have two questions: I have created a hook which is to bring attention to the clients customer id on the Dashboard page. (See code below). At current, it just links to the Profile Update page where a custom field shows the ClientID. However, I want to show this custom field in the actual panel - but thus far no amount of placing {$client_custom_field_custid} into the code will display it! Any idea how to get that to display? In the Update Profile page (where users can edit their details) you can see the custom ID. However, this isa editable and the user can change it. Is there a way to prevent the user from being able to update? i.e. read-only? Thanks in advance and any help is appreciated! Brad <?php use WHMCS\View\Menu\Item; add_hook('ClientAreaHomepagePanels', 1, function (Item $homePagePanels) { $Message = <<<EOT <p>For some extra assurance, all SaneChoice clients have a unique identification code. </p> EOT; $homePagePanels->addChild('thanks', array( 'label' => 'Your Client ID', 'icon' => 'fa-thumbs-up', 'order' => 20, 'extras' => array( 'color' => 'gold', 'btn-link' => 'https://clients.sanechoice.com/clientarea.php?action=details', 'btn-text' => 'View ClientID', 'btn-icon' => 'fa-arrow-right', ), 'bodyHtml' => $Message, )); }); 0 Quote Link to comment Share on other sites More sharing options...
pRieStaKos Posted March 29, 2022 Share Posted March 29, 2022 (edited) 1. Use `$currentUser = CurrentUser::client();` to get client data and customFieldValues. Return your customfield with filter (if). 2. Use Smarty `{if}` to set the field as read-only, after you filter the correct customfield (id/name). Edited March 29, 2022 by pRieStaKos 0 Quote Link to comment Share on other sites More sharing options...
SaneChoiceLtd Posted March 29, 2022 Author Share Posted March 29, 2022 Hello, Hmm, thanks for this. However I am not a developer so wonder if you can provide an extended answer? i.e. so I can see how you would display the value of a custom field. Thanks, Brad 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 29, 2022 Share Posted March 29, 2022 2 hours ago, SaneChoiceLtd said: Hmm, thanks for this. However I am not a developer so wonder if you can provide an extended answer? i.e. so I can see how you would display the value of a custom field. If you're not a developer, this is an odd statement: "I have created a hook which is to bring attention to the clients customer id on the Dashboard page" 0 Quote Link to comment Share on other sites More sharing options...
SaneChoiceLtd Posted March 29, 2022 Author Share Posted March 29, 2022 Just now, bear said: If you're not a developer, this is an odd statement: "I have created a hook which is to bring attention to the clients customer id on the Dashboard page" Well, created is a bit strong. Copied an additional hook template and tried my best to make work! (And failed miserably in the process). 0 Quote Link to comment Share on other sites More sharing options...
bear Posted March 29, 2022 Share Posted March 29, 2022 Been there, done that. 🙂 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.