In the ClientAreaDomainDetailsOutput WHMCS hook, the structure of data  available in the function is this:

array (
    'domain' => WHMCS\Domain\Domain::__set_state(array(
        'table' => 'tbldomains',
        'dates' => array (
            0 => 'registrationdate',
            1 => 'expirydate',
            2 => 'nextduedate',
            3 => 'nextinvoicedate',
         ),
         'columnMap' => array (
             'clientId' => 'userid',
             'registrarModuleName' => 'registrar',
             'promotionId' => 'promoid',
             'paymentGateway' => 'paymentmethod',
             'hasDnsManagement' => 'dnsmanagement',
             'hasEmailForwarding' => 'emailforwarding',
             'hasIdProtection' => 'idprotection',
             'hasAutoInvoiceOnNextDueDisabled' => 'donotrenew',
             'isSyncedWithRegistrar' => 'synced',
             'isPremium' => 'is_premium',
         ),
         'booleans' => array (
             0 => 'hasDnsManagement',
             1 => 'hasEmailForwarding',
             2 => 'hasIdProtection',
             3 => 'isPremium',
             4 => 'hasAutoInvoiceOnNextDueDisabled',
             5 => 'isSyncedWithRegistrar',
         ),
         'characterSeparated' => array (
             '|' => array (
                 0 => 'reminders',
             ),
         ),

        'appends' => array (
             0 => 'tld',
             1 => 'domainPunycode',
             2 => 'extension',
             3 => 'gracePeriod',
             4 => 'gracePeriodFee',
             5 => 'redemptionGracePeriod',
             6 => 'redemptionGracePeriodFee',
         ),
         'unique' => array ( ),
         'guardedForUpdate' => array ( ),
         'strings' => array ( ),
         'ints' => array ( ),
         'fillable' => array ( ),
         'semanticVersions' => array ( ),
         'commaSeparated' => array ( ),
         'rules' => array ( ),
         'errors' => NULL,
         'customValidationMessages' => array ( ),
         'connection' => 'default',
         'primaryKey' => 'id',
         'keyType' => 'int',
         'incrementing' => true,
         'with' => array ( ),
         'withCount' => array ( ),
         'perPage' => 15,
         'exists' => true,
         'wasRecentlyCreated' => false,
         'attributes' => array (
             'id' => 2,
             'userid' => 1,
             'orderid' => 5,
             'type' => 'Register',
             'registrationdate' => '2022-09-13',
             'domain' => 'example.com',
             'firstpaymentamount' => '90.00',
             'recurringamount' => '90.00',
             'registrar' => 'DomainRegister',
             'registrationperiod' => 1,
             'expirydate' => '2025-08-05',
             'subscriptionid' => '',
             'promoid' => 0,
             'status' => 'Active',
             'nextduedate' => '2022-09-13',
             'nextinvoicedate' => '2022-09-13',
             'additionalnotes' => '',
             'paymentmethod' => 'mailin',
             'dnsmanagement' => 0,
             'emailforwarding' => 0,
             'idprotection' => 0,
             'is_premium' => 0,
             'donotrenew' => 0,
             'reminders' => '',
             'synced' => 1,
             'created_at' => '0000-00-00 00:00:00',
             'updated_at' => '0000-00-00 00:00:00',
         ),
         'original' => array (
             'id' => 2,
             'userid' => 1,
             'orderid' => 5,
             'type' => 'Register',
             'registrationdate' => '2022-09-13',
             'domain' => 'example.com',
             'firstpaymentamount' => '90.00',
             'recurringamount' => '90.00',
             'registrar' => 'DomainRegister',
             'registrationperiod' => 1,
             'expirydate' => '2025-08-05',
             'subscriptionid' => '',
             'promoid' => 0,
             'status' => 'Active',
             'nextduedate' => '2022-09-13',
             'nextinvoicedate' => '2022-09-13',
             'additionalnotes' => '',
             'paymentmethod' => 'mailin',
             'dnsmanagement' => 0,
             'emailforwarding' => 0,
             'idprotection' => 0,
             'is_premium' => 0,
             'donotrenew' => 0,
             'reminders' => '',
             'synced' => 1,
             'created_at' => '0000-00-00 00:00:00',
             'updated_at' => '0000-00-00 00:00:00',
         ),
         'changes' => array ( ),
         'casts' => array ( ),
         'classCastCache' => array ( ),
         'dateFormat' => NULL,
         'dispatchesEvents' => array ( ),
         'observables' => array ( ),
         'relations' => array ( ),
         'touches' => array ( ),
         'timestamps' => true,
         'hidden' => array ( ),
         'visible' => array ( ),
         'guarded' => array (
             0 => '*',
          ),
      )),
)

 

So i.e. following variables are defined:

$domainName = $domain->domain;
$clientModel = $domain->client;
$domainStatus = $domain->status;
$domainNextDueDate = $domain -> nextduedate;
$domainExpiryDate = $domain -> expirydate;
$domainDoNotRenew = $domain -> donotrenew;
$domainRegistrar = $domain -> registrar;
$clientName = $clientModel->firstName . ' ' . $clientModel->lastName;

Found this article interesting?
Subscribe to DomainRegister´s newsletter!

You can unsubscribe at any time by simply clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp s privacy practices here.

  • WHMCS
  • 0 Utenti hanno trovato utile questa risposta
Hai trovato utile questa risposta?

Articoli Correlati

 How to add a favicon in WHMCS

To add a favicon to your WHMCS install: copy your favicon (es. myfavicon.ico) in WHMCS folder...

 How to comment in template (.tpl) files

If you need to insert a comment in a .tpl file, or comment a block of code to disable it, you...

 How to insert a Youtube video in WHMCS knowledgebase article

To insert a YouTube video in an article of the WHMCS knowledge base, you need to insert following...

 How to disable a customer to pay invoices partly with credit balance

in WHMCS if a customer has not enough credit balance for full payment of an invoice, WHMCS allows...

 How to add a cookie bar to WHMCS

In order to add a cookie bar to your own installation of WHMCS: copy somewhere on your WHMCS...