Jump to content

domain next due date ...


Remitur

Recommended Posts

In a Registrar module, for a certain domain I need to recover the  value of nextduedate ... but this value is no in the module parameters: https://developers.whmcs.com/domain-registrars/module-parameters/

Neither I found any way to get this value directly from WHMCS, and it seems it's required to query it directly from db... 😮

In email templates does exist the $domain_next_due_date variable, but I guess it's not available out of there...

Am I right, or there's some kind of trick I don't know?!

Link to comment
Share on other sites

  • WHMCS Staff

Hi @Remitur,

Thanks for posting to the Community!

This value can be returned by adding the following code to the top of your module file:

use WHMCS\Domain\Domain;

You can then use the following code in your module function to retrieve this value:

try {
    $domainInfo = Domain::findOrFail($params['domainid']);
    $domainNextDueDate = $domainInfo->nextDueDate;
} catch (\Exception $e) {
    // Perform any actions if the domain can't be found here.
}

This will then provide you the Domains next due date via the $domainNextDueDate variable we specified above.

I trust this provides you with enough information to forward the development of your custom registrar module. For information on the code I have provided, you can check out the following documentation:

https://docs.whmcs.com/Using_Models

https://docs.whmcs.com/classes/7.6/WHMCS/Domain/Domain.html

Link to comment
Share on other sites

4 minutes ago, Remitur said:

Neither I found any way to get this value directly from WHMCS, and it seems it's required to query it directly from db...

not necessarily...

4 minutes ago, Remitur said:

Am I right, or there's some kind of trick I don't know?!

I don't know which tricks you don't know! lol 🙂

using the Class docs would be one option if you don't want to query the database tables...

https://docs.whmcs.com/classes/7.6/WHMCS/Domain/Domain.html

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