Jump to content

Hook to add domain AfterModuleCreate


Recommended Posts



I'm trying to make a hook that runs After Module Create.


It should simply add the domain as a separate order with zero cost, just so the customer can see his domain on the client area.


I've already tweaked the client area to show just expiration date and whois link for "domains" page.


I've set this hook up, but it isn't working.


if (!defined("WHMCS"))
   die("This file cannot be accessed directly");

function add_domain_on_create($vars) {

$domain = $vars['params']['domain'];
$userid = $vars['params']['userid'];

$command = "addorder";
$adminuser = "admin";
$values["clientid"] = $userid;
$values["domain"] = $domain;
$values["billingcycle"] = "free";
$values["domaintype"] = "register";
$values["regperiod"] = 10;

$results = localAPI($command,$values,$adminuser);



Can somebody help me out with that?

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.

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