VirtualC Posted March 8, 2021 Share Posted March 8, 2021 Hi, I'm using ResellerClub as a registrar. What I'd like to do in WHMCS is to automatically have the ID Protection box checked when a customer is purchasing a domain. So far I haven't found how to do this in the documentation or from ResellerClub tech support. Any suggestions where I can look or how to do this? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 8, 2021 Share Posted March 8, 2021 7 hours ago, VirtualC said: I'm using ResellerClub as a registrar. What I'd like to do in WHMCS is to automatically have the ID Protection box checked when a customer is purchasing a domain. in the cart ? if so, you can do that with a simple hook or template change... I assume that the user will have the option to uncheck the box if they want to? if not, then you might be into the realms of either hiding the enabled panel in the cart, or enabling it before sending the registration data to the registrar - though as RC charge for IDP I believe and I assume you want to charge the customer for this, I think it would be better to tackle this in the cart. also, if the client disabled the addon, went to viewcart and then returned to edit the domain settings, it would be enabled by default again - you might be able to get around that with additional coding, but that's how it would work without further modification. 0 Quote Link to comment Share on other sites More sharing options...
VirtualC Posted March 10, 2021 Author Share Posted March 10, 2021 Thanks. Yes, in the cart. By default we would like the ID Protection box checked and the user would have the option of unchecking it. I'm not quite sure how to make that change. Any recommendations of somebody I could contact to help with this option? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 10, 2021 Share Posted March 10, 2021 7 hours ago, VirtualC said: Thanks. Yes, in the cart. By default we would like the ID Protection box checked and the user would have the option of unchecking it. ok, then it's just a variation on a hook I was sure that I had previously posted in these forums, but couldn't find yesterday... I delayed posting immediately in case you needed it to go further... 7 hours ago, VirtualC said: I'm not quite sure how to make that change. Any recommendations of somebody I could contact to help with this option? me. <?php # Enable ID Protection in Cart Hook # Written by brian! function enable_id_protection_in_cart_hook($vars) { if ($vars['templatefile']=="configuredomains") { $domains = $vars['domains']; foreach ($domains as $key => $domain) { if ($domain['idprotection'] == 1) { $domains[$key]['idprotectionselected'] = true; } } return array("domains" => $domains); } } add_hook("ClientAreaPageCart", 1, "enable_id_protection_in_cart_hook"); so if IDP is enabled for the TLD in the cart, the IDP checkbox will now be ticked by default... though they can untick if they wish to. btw - remember that IDP can't necessarily be applied to all TLDs... the general rule is that you can use it for gTLDs (.com, .net etc) but not ccTLDs (.uk, .de etc) - the biggest exception to that rule (there will be others) would be ccTLDs that are promoted as gTLDs (e.g tv, .cc, .co etc). 0 Quote Link to comment Share on other sites More sharing options...
VirtualC Posted March 10, 2021 Author Share Posted March 10, 2021 You're awesome. Thanks! 0 Quote Link to comment Share on other sites More sharing options...
Evolve Web Hosting Posted March 10, 2021 Share Posted March 10, 2021 I came across this and wanted to test it out too. It's checking the box for ID Protection but it's not actually adding it in the cart. Once you advance in the cart, towards checkout, ID Protection is not applied in the total. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted March 10, 2021 Share Posted March 10, 2021 26 minutes ago, evolve hosting said: I came across this and wanted to test it out too. It's checking the box for ID Protection but it's not actually adding it in the cart. adding it to the cart occurs when you press the continue button at the bottom of the page - you don't need to press the "Add To Cart" button as that would effectively remove it. 27 minutes ago, evolve hosting said: Once you advance in the cart, towards checkout, ID Protection is not applied in the total. that's not what i'm seeing occurring... 0 Quote Link to comment Share on other sites More sharing options...
Evolve Web Hosting Posted March 10, 2021 Share Posted March 10, 2021 It's working. It confused me that when I changed from 1 year to anything else, the center portion of the screen shows the price without ID protection and off to the right under order summary, it has the full price. 0 Quote Link to comment Share on other sites More sharing options...
VirtualC Posted March 10, 2021 Author Share Posted March 10, 2021 Stupid question. Which file should I add this code to? 0 Quote Link to comment Share on other sites More sharing options...
Evolve Web Hosting Posted March 10, 2021 Share Posted March 10, 2021 (edited) 3 minutes ago, VirtualC said: Stupid question. Which file should I add this code to? Create a new file within the includes/hooks folder of your install https://developers.whmcs.com/hooks/getting-started/ Edited March 10, 2021 by evolve hosting 0 Quote Link to comment Share on other sites More sharing options...
VirtualC Posted March 10, 2021 Author Share Posted March 10, 2021 Thanks. I remembered just as clicked the Submit Reply button. Too late to take it back. At least your reply will be helpful to future viewers! 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.