Results 1 to 2 of 2

Thread: action hook PreModuleCreate

  1. #1
    Join Date
    Feb 2012
    Posts
    3

    Question action hook PreModuleCreate

    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...reModuleCreate but te below code is not working.

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

    Any idea what I am doing wrong?

  2. #2
    Join Date
    Sep 2007
    Location
    Jimboomba, Qld. AU
    Posts
    2,291

    Default

    You will be best to use the "AfterModuleCreate" hook and then update the db directly like this
    PHP Code:
    update_query("tblhosting",array("domain"=>$vars['params']['customfields']['documentId']),array("id"=>$vars["params"]["serviceid"])); 

Similar Threads

  1. Action Hook not working
    By SoftSmart.co.za in forum Customisation & Integration Questions
    Replies: 1
    Last Post: 04-04-13, 02:54 PM
  2. Help With Hook PreModuleCreate
    By BlueVM in forum Customisation & Integration Questions
    Replies: 1
    Last Post: 09-27-12, 12:01 PM
  3. AWOL Action Hook
    By ZeroGravity in forum Customisation & Integration Questions
    Replies: 2
    Last Post: 05-03-11, 07:58 AM
  4. Need some help with an action hook
    By Milliment in forum Customisation & Integration Questions
    Replies: 7
    Last Post: 02-26-10, 08:30 AM