Danse Posted July 26, 2021 Share Posted July 26, 2021 (edited) Hi, does anyone has a Hook which auto enables the DNS of new Domains in WHMCS? Customers always complaining that DNS Management is missing and i have to switch that on, all the Time. And i wont take this as upselling position. So activate DNS Management in Frontend for "0$" is aswell not suitable for me. It just be there and done 🙂 Any Suggestions, or Code Templates? Edited July 26, 2021 by Danse 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted July 27, 2021 Share Posted July 27, 2021 Using the AfterRegistrarRegistration hook and internal classes, you should be able to do that with: <?php use WHMCS\Domain\Domain; add_hook('AfterRegistrarRegistration', 1, function ($vars) { $Domain = Domain::find($vars['domainid']); if ($Domain) { $Domain->hasDnsManagement = true; $Domain->save(); } }); Have not tested that, just what should work. 1 Quote Link to comment Share on other sites More sharing options...
Danse Posted July 27, 2021 Author Share Posted July 27, 2021 Wow, thank you in advance. I will test that with next Domain Order. ❤️ 0 Quote Link to comment Share on other sites More sharing options...
PapaKai Posted July 29, 2021 Share Posted July 29, 2021 (edited) But this just sets it active for WHMCS, no DNS created at registrar level, i guess. Right? Use the PreRegistrarRegistration hook to manipulate $params["dns management"] (by changing $vars accordingly) to always be 1 and to toggle dns management using the mentioned Domain Class to 1. Just my 2 cents. HTH Edited July 29, 2021 by PapaKai 1 Quote Link to comment Share on other sites More sharing options...
Danse Posted July 30, 2021 Author Share Posted July 30, 2021 Thanks. I just need the DNS "Customer can Edit" Option to be enabled always per default. I also took same code and made that for aftertransferevent. So if register or transfer, die DNS Management in Frontend is activated per default. Anyways, thank you!! 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.