Remitur Posted March 10, 2019 Share Posted March 10, 2019 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?! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Staff WHMCS Peter Posted March 10, 2019 WHMCS Staff Share Posted March 10, 2019 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 1 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 10, 2019 Share Posted March 10, 2019 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 1 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.