Jump to content

HomePage Panel with Custom Field


Recommended Posts

Hi All,

I am driving myself mad with this, so time to call in people with bigger brains than I! I have two questions:

  1. 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?
  2. 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,
    ));
});

 

Link to comment
Share on other sites

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"

Link to comment
Share on other sites

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). 

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