Rowan S Posted April 14, 2022 Share Posted April 14, 2022 Hello, Is anybody able to assist with a issue I’m having with my WHMCS licence module. The WHMCS licence module is a module which automatically registers/creates WHMCS licences. The idea is that you could utilise the daily cron hook point to run some additional code to check every WHMCS licence addon’s check the next due date and cancel the license if it’s in the past. I don’t believe that this would be too difficult to code but I am not familiar with this. It would be greatly appreciated if somebody could code this for me. Thanks! 1 Quote Link to comment Share on other sites More sharing options...
wsa Posted April 14, 2022 Share Posted April 14, 2022 Hi, We will be very happy to assist you with this project. Please contact us at https://www.whmcsservices.com/customwhmcs.php Hope to hear from your 0 Quote Link to comment Share on other sites More sharing options...
WGS Posted April 15, 2022 Share Posted April 15, 2022 Hi, You can hire us for WHMCS custom development work here 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Development Company Posted April 18, 2022 Share Posted April 18, 2022 On 4/15/2022 at 2:49 AM, Rowan S said: Hello, Is anybody able to assist with a issue I’m having with my WHMCS licence module. The WHMCS licence module is a module which automatically registers/creates WHMCS licences. The idea is that you could utilise the daily cron hook point to run some additional code to check every WHMCS licence addon’s check the next due date and cancel the license if it’s in the past. I don’t believe that this would be too difficult to code but I am not familiar with this. It would be greatly appreciated if somebody could code this for me. Thanks! Hi @Rowan S We can help you with the issue you are facing in your License Module. We are familiar with this kind of issues. You can simply click here to submit a ticket on our website to start the process. Looking forward for to work with you. Regards 0 Quote Link to comment Share on other sites More sharing options...
DennisHermannsen Posted April 19, 2022 Share Posted April 19, 2022 This should do the job: <?php use WHMCS\Database\Capsule; add_hook('DailyCronJob', 1, function($vars) { $today = toMySQLDate(getTodaysDate(false)); $products = Capsule::Table('tblhosting') ->select('id') ->where('status', 'Active') ->where('nextduedate', '<=', $today) ->get(); foreach($products as $product){ $command = 'ModuleTerminate'; $postData = array( 'serviceid' => $products->id, ); localAPI($command, $postData); } }); It'll work for all products, however. You should add a 'where' clause to only get specific products. 1 Quote Link to comment Share on other sites More sharing options...
Rowan S Posted April 20, 2022 Author Share Posted April 20, 2022 16 hours ago, DennisHermannsen said: This should do the job: <?php use WHMCS\Database\Capsule; add_hook('DailyCronJob', 1, function($vars) { $today = toMySQLDate(getTodaysDate(false)); $products = Capsule::Table('tblhosting') ->select('id') ->where('status', 'Active') ->where('nextduedate', '<=', $today) ->get(); foreach($products as $product){ $command = 'ModuleTerminate'; $postData = array( 'serviceid' => $products->id, ); localAPI($command, $postData); } }); It'll work for all products, however. You should add a 'where' clause to only get specific products. Hiya, thank you so much for providing this for me. I’ll give it a go in the development environment and get back to you. Thanks! 0 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.