Jump to content
Remitur

domain next due date ...

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?!

Share this post


Link to post
Share on other sites

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

  • Thanks 1

Share this post


Link to post
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

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated