How to hide a field from WHMCS register.php?

5 Nov

How to hide a field from WHMCS register.php?

If you have to remove a form field from the WHMCS register file, How you can do it?

It can be done using a hook named ClientAreaFooterOutput.

Assume that the field’s id is  myfield. Then you can create a file named hook_register_hide.php and place it in include/hooks folder.

<?php
add_hook('ClientAreaFooterOutput', 1, function ($vars)
{
$filename = $vars['filename'];
if($filename == "register") {
$string = "<script type='text/javascript'>";
$string .=  "        $(function() {  ";
$string .= "$('#myfield').addClass('hidden')";
$string .=  "});";
$string .= "</script> ";
return $string;
}
});