criat Posted February 2, 2015 Share Posted February 2, 2015 Hello, 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. Can somebody help me out with that hook? 0 Quote Link to comment Share on other sites More sharing options...
criat Posted February 2, 2015 Author Share Posted February 2, 2015 What's wrong with this, for example? 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); } add_hook("AfterModuleCreate",1,"add_domain_on_create"); 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 2, 2015 Share Posted February 2, 2015 you may need to output/print the response from API cal ($result) to see what's wrong as a start,,, also $values['regperiod'] = 10; mean 10 years!!! 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.