Magistar Posted June 15, 2017 Share Posted June 15, 2017 Hi there. I would like to disable captcha on the domain checker. However I would love to leave it enabled on the other places it shows up (e.g. login, etc). I tried to modify the theme so that CAPTCHA is not displayed, but then it does not allow me to search. Has anyone solved this? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 15, 2017 Share Posted June 15, 2017 we might need to know your WHMCS version and orderform template - but I think just removing the entire {if $captcha} block of code would work on v7.2 and standard_cart... or the same outcome could likely be achieved using an action hook. <?php function domain_register_captcha_hook($vars) { if ($vars['templatefile'] == 'domainregister'){ return array("captcha" => ""); } } add_hook("ClientAreaPageCart", 1, "domain_register_captcha_hook"); 0 Quote Link to comment Share on other sites More sharing options...
Magistar Posted June 15, 2017 Author Share Posted June 15, 2017 (edited) we might need to know your WHMCS version and orderform template - but I think just removing the entire {if $captcha} block of code would work on v7.2 and standard_cart... or the same outcome could likely be achieved using an action hook. <?php function domain_register_captcha_hook($vars) { if ($vars['templatefile'] == 'domainregister'){ return array("captcha" => ""); } } add_hook("ClientAreaPageCart", 1, "domain_register_captcha_hook"); Thanks for the suggestion. Looks like a solid solution. However I am not that experienced with modding WHMCS. Where would I place that code? ps. Now running 7.2, last attempts I made was 6.3. Per your suggestion I removed the lines from domainregister.tpl in the standard cart. This worked for the search page. Of course the captcha still displays on the homepage. After some searching I found the entry in header.tpl. Edited June 15, 2017 by Magistar 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 16, 2017 Share Posted June 16, 2017 Thanks for the suggestion. Looks like a solid solution. However I am not that experienced with modding WHMCS. Where would I place that code? you would create a new .php file in /includes/hooks and paste the above code into it. Per your suggestion I removed the lines from domainregister.tpl in the standard cart. This worked for the search page. Of course the captcha still displays on the homepage. After some searching I found the entry in header.tpl. I suspect you may have to remove more than just the include file if you want the homepage form to pass the search query to domain checker by changing... <form method="post" action="domainchecker.php"> <div class="row"> <div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1"> <div class="input-group input-group-lg"> <input type="text" class="form-control" name="domain" placeholder="{$LANG.exampledomain}" autocapitalize="none" /> <span class="input-group-btn"> {if $registerdomainenabled} <input type="submit" class="btn search" value="{$LANG.search}" /> {/if} {if $transferdomainenabled} <input type="submit" name="transfer" class="btn transfer" value="{$LANG.domainstransfer}" /> {/if} </span> </div> </div> </div> {include file="$template/includes/captcha.tpl"} </form> to... <form method="post" action="cart.php?a=add&domain=register"> <div class="row"> <div class="col-md-8 col-md-offset-2 col-sm-10 col-sm-offset-1"> <div class="input-group input-group-lg"> <input type="text" class="form-control" name="query" placeholder="{$LANG.exampledomain}" autocapitalize="none" /> <span class="input-group-btn"> {if $registerdomainenabled} <input type="submit" class="btn search" value="{$LANG.search}" /> {/if} {if $transferdomainenabled} <input type="submit" name="transfer" class="btn transfer" value="{$LANG.domainstransfer}" /> {/if} </span> </div> </div> </div> </form> 0 Quote Link to comment Share on other sites More sharing options...
Magistar Posted June 17, 2017 Author Share Posted June 17, 2017 Wow amazing support! I tried the hook method as replacement for the mod in domainregister.tpl and worked like a charm. Did notice that when you used the box on the homepage you had to press search manually. So I tried the header update you suggested and that problem also disappeared! Thanks . 0 Quote Link to comment Share on other sites More sharing options...
Shobha Patwal Posted February 10, 2020 Share Posted February 10, 2020 Where you have add the code for disabling captcha in domainregister.tpl file? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted February 10, 2020 Share Posted February 10, 2020 45 minutes ago, Shobha Patwal said: Where you have add the code for disabling captcha in domainregister.tpl file? if that hook still works ono recent versions (I haven't checked), then you wouldn't add it to the template - it's an action hook and therefore you would create a .php file in /includes/hooks, give it a memorable filename and paste the code into it. however, take a look at the reply I just posted to your similar question in another thread - that should be a better solution. 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.