lphanishashank Posted March 19, 2013 Share Posted March 19, 2013 (edited) Hi, I am pretty new to WHMCS and programming in general. I have a question regarding hooks I can use. Your help will be much appriciated. I want to write a hook in a addon module to capture the client information after a product is purchased. The hook I am planning to write is like this in hook.php function hook_capture_details($params) { $cpanel_serviceid = $vars["serviceid"]; $cpanel_accountid = $vars["accointid"]; $cpanel_domain = $vars["domain"]; } add_hook("AfterModuleCreate",1,"hook_capture_details"); I now want to get the above variables into another php file where I will be needing these variables in another functions. How can I do that? Also I read in http://docs.whmcs.com/Hooks Module hooks that "To define hooks as part of a module, simple create a file named "hooks.php" within the module folder, and include all module specific hook related code within that file." I did not get the exact meaning of that statement. I understood by the above statement that to create hooks for modules I have to create a hook.php file in the module folder and write the different hooks for different addon modules all in the same hook.php file. Did I interprit the statement correctly? Please help me with this query. Edited March 19, 2013 by lphanishashank 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.