spartanza Posted June 5, 2018 Share Posted June 5, 2018 As the title says, I would like the ability to hide the "I will use my existing domain and update my nameservers" option on the domain sign up on specific services only 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted June 5, 2018 Share Posted June 5, 2018 3 hours ago, spartanza said: As the title says, I would like the ability to hide the "I will use my existing domain and update my nameservers" option on the domain sign up on specific services only then it's going to be a variation on the hook I posted in the thread below... <?php /** * Configure Domain Settings For Products * @author brian! */ add_hook("ClientAreaPageCart",1,function($vars){ global $productinfo; $validproducts = [1,2,3,4,5,45]; if (in_array($productinfo['pid'],$validproducts)) { return array("owndomainenabled" => ""); } }); $validproducts is an array of product IDs that you want to HIDE the existing domain option for - so all you should need to do is edit that array, and those products will not give the user the option of using their own domain during ordering. 1 Quote Link to comment Share on other sites More sharing options...
vb2cans Posted July 20, 2023 Share Posted July 20, 2023 (edited) This code is using a ClientAreaFooterOutput hook to inject a JavaScript snippet into the footer of the client area pages. This script hides all domain nameserver input fields by selecting elements with names starting with "domainns" and then hiding the closest parent element with the class "col-sm-4." This is an effective approach to hide the domain nameserver input fields on the client area pages. When the page loads, the script will run, and all the nameserver input fields will be hidden. You will also need to edit the /lang/english.php file. //$_LANG['domainnameservers'] = "Nameservers"; //$_LANG['cartnameserversdesc'] = "If you want to use custom nameservers then enter them below. By default, new domains will use our nameservers for hosting on our network."; Please make sure to place this PHP code in a file for example. remove_nameservers_code.php within the includes/hooks directory of your WHMCS installation. <?php add_hook('ClientAreaFooterOutput', 1, function() { return <<<HTML <script> $(document).ready(function() { // Hide all domain nameserver input fields $('[name^="domainns"]').closest('.col-sm-4').hide(); }); </script> HTML; }); Edited July 20, 2023 by vb2cans 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.