tobiasp Posted January 19, 2017 Share Posted January 19, 2017 Hi, how can I manage following scenarios: User registers/transfers a Domain and orders webhosting -> Nameserver-Set A should be used (General Settings->Domains->Default NS) because they point to the nameservers for the different webhosting servers. User registers/transfers a Domain and orders no webhosting -> Nameserver-Set B should be used (the ones from the domain registrar so that the built in DNS management can be used) also the DNS Management feature should be enabled by default when ordering domain only. How could I achieve this? cheers 0 Quote Link to comment Share on other sites More sharing options...
steven99 Posted January 20, 2017 Share Posted January 20, 2017 Hooks and API: For registrations, use https://developers.whmcs.com/hooks-reference/registrar-module/#afterregistrarregistration . For transfers, use https://developers.whmcs.com/hooks-reference/registrar-module/#afterregistrartransfer . In the hook, get client services and if none, use the set "B" that you'll need to hard code or otherwise have outside of WHMCS's defaults. Then you would call the updatenameservers API: https://developers.whmcs.com/api-reference/domainupdatenameservers/ within the hook. However, note that updating the nameservers for transfers could potentially cause downtime / issues for the customer if the DNS records are not pointed to their proper place and as such I would be recommend only doing this for registrations. 0 Quote Link to comment Share on other sites More sharing options...
tobiasp Posted January 21, 2017 Author Share Posted January 21, 2017 Okay thanks for the idea. I would also like this to be shown in the frontend. On the page "cart.php?a=confdomains" when a domain without hosting is in the cart there are the fields for changing the nameserver displayed and populated with the default ones (Set A). when having a domain with hosting in the cart there is no nameserver settings shown (and I guess whmcs will use the ones from the settings) So do you think it would be the best course of action to set the ones for domain-only in the backend so that they are displayed in the "choose your nameserver fields" but override them when domain+hosting is checked out... 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.