Jump to content

Creating a addon module need help please...


Recommended Posts

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 by lphanishashank
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