Jump to content

action hook PreModuleCreate


Sreejit

Recommended Posts

I have custom custom field named "documentId" for a product. When a client singup for a service and fills in this field, I want the domain name to be set to this "documentId" value. I tried do this using action hook PreModuleCreate http://docs.whmcs.com/Hooks:Products/Services#PreModuleCreate but te below code is not working.

 

$vars['params']['domain'] = $vars['params']['customfields']['documentId'];

 

Any idea what I am doing wrong?

Link to comment
Share on other sites

Thanks Sparky, As per your suggestion, I used the below code in whmcsdir/includes/hooks/example.php but it' still not working. The domain field is still blank. I am using WHMCS Version: 5.0.3

 

function hook_updatedatanew($vars)
{
update_query("tblhosting",array("domain"=>$vars['params']['customfields']['documentId']),array("id"=>$vars["params"]["serviceid"]));  

}

add_hook("AfterModuleCreate",1,"hook_updatedatanew");

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated