hostservice_71 Posted November 3, 2015 Share Posted November 3, 2015 Hi, there's several extensions like the popular .nl where the registrar does not use the Registrar Lock option. Still, customers with those tld's (about 90% of our customer base) still see an option in their account to Lock. When they click they get an error and start sending in support tickets. How do we disable the option for certain tld's? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 3, 2015 Share Posted November 3, 2015 How do we disable the option for certain tld's? you may need to use a combination of hooks and template edits to achieve this - as I believe the reglock page can be visited via the sidebar, manage domain and bulk changes. to remove the Registrar Lock link from the sidebar for specific TLDs, you could use the following hook... <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { $domain = Menu::context('domain'); $mydomain = $domain->domain; $tld = substr($mydomain, strrpos($mydomain, ".")+1); $blockedtlds = array('eu','nl'); if (in_array($tld, $blockedtlds)) { if (!is_null($primarySidebar->getChild('Domain Details Management'))) { $primarySidebar->getChild('Domain Details Management') ->removeChild('Registrar Lock Status'); } } }); in this case, .eu and .nl domains will not show the registrar lock link (regardless of whether it's available through the registrar module assigned to the TLD). with regards to manage domain, you could add the following Smarty code to the beginning of clientareadomaindetails.tpl.. {$tld=substr($domain, strrpos($domain, ".")+1)} {$blockedtlds=['eu','nl']} {if in_array($tld,$blockedtlds)} {$managementoptions.locking = false} {/if} this will remove the "Change the registrar lock status for your domain" link from the page for the specified TLDs... it's written in Smarty v3, so will only work in WHMCS v6+... you could make this into another hook (clientareapage) to avoid modifying the template, but for simplicity, i've used Smarty code. to remove the bulk reglock option, just delete the link from clientareadomains.tpl... <li><a href="#" id="reglock" class="setBulkAction"><i class="glyphicon glyphicon-lock"></i> {$LANG.domainreglockstatus}</a></li> ... or you could just edit the tabRegLock block of clientareadomaindetails.tpl and modify the text if the domain is from one of your specified TLDs. 0 Quote Link to comment Share on other sites More sharing options...
gbotica Posted November 5, 2015 Share Posted November 5, 2015 Thanks so much for this! I have the same issue and was struggling to figure out how to do it. It was so easy in WHMCS v5, with the $tld template var, but this is missing in v6. I prefer to do it with hooks though, just seems cleaner. 0 Quote Link to comment Share on other sites More sharing options...
gbotica Posted November 8, 2015 Share Posted November 8, 2015 In case it helps someone ... here's how I ended up removing the Domain Lock option from the Domain Details page, using a hook: add_hook('ClientAreaPageDomainDetails', 1, function ($vars) { /* set unsupported TLDs and get current domain's TLD*/ $unsupportedTLDs = array( // domains that don't support locking ); $domain = Menu::context('domain'); $this_domain = $domain->domain; $tld = substr($this_domain, strrpos($this_domain, ".") + 1); /*---------- hide registrar lock options for unsupported TLDs ----------*/ if (in_array($tld, $unsupportedTLDs)) { $vars['managementoptions']['locking'] = false; $vars['lockstatus'] = false; return $vars; } }); 0 Quote Link to comment Share on other sites More sharing options...
hostservice_71 Posted November 10, 2015 Author Share Posted November 10, 2015 In what file do you do this? Sorry it took little to respond. I'm flabbergasted this needs to be done in such a complicated way and is not just a simply tick box in admin option. Next to mail forwarding, DNS control and EPP code. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 10, 2015 Share Posted November 10, 2015 In what file do you do this? any hooks will go in the includes/hooks directory - for the template edits, i've specified the file to edit. Sorry it took little to respond. I'm flabbergasted this needs to be done in such a complicated way and is not just a simply tick box in admin option. Next to mail forwarding, DNS control and EPP code. if you think the above is complicated, I dread to think what the module code to add this feature to the domain pricing would look like! I guess you could make an addon to do that, but it would be easier for WHMCS to do it themselves... you could make a feature request for this, but I wouldn't hold your breath waiting for it to be implemented. 0 Quote Link to comment Share on other sites More sharing options...
Yash Posted December 7, 2022 Share Posted December 7, 2022 Brian thanks for the hook, but my question is, is that possible to disable only for certain registry ??? 0 Quote Link to comment Share on other sites More sharing options...
Daniel C Posted June 30, 2023 Share Posted June 30, 2023 Perhaps someday they will introduce it as a standard feature in WHMCS. ^ ^ 🥳 0 Quote Link to comment Share on other sites More sharing options...
Kuhl, Rubens Posted October 25 Share Posted October 25 I wonder if this is now standard in 2024 WHMCS versions ? Or this type of code still required ? 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.