deezon Posted February 6, 2015 Share Posted February 6, 2015 Hello Everyone, We are trying to monitor conversions by adding a code to Invoice PAID page. Since every time an invoice generated, it's dynamically generated, so what's the best way to place code on Invoice PAID page? I figured that we can create a WHMCS module with sole purpose of displaying a code on that page but still got no clue on what are the steps. I'm sure the steps are pretty basic, so if anyone has experience with modules etc., do give your suggestion. Thanks in advance 0 Quote Link to comment Share on other sites More sharing options...
sentq Posted February 6, 2015 Share Posted February 6, 2015 it can be done easily using action hooks, create new file inside " /includes/hooks/ " directory with any name e.g. "codeinsideinvoice.php" and place the following code inside it: <?php function hook_insideInvoice($vars){ # Place Your Code In This Variable $myCode = ""; if ($vars['filename']=="viewinvoice"){ if (isset($vars['status']) && $vars['status']=="Paid"){ return array("mycodepaidinvoice" => $myCode); } }}add_hook("ClientAreaPage", 1, "hook_insideInvoice");?> and inside viewinvoice.tpl you can place this tag {$mycodepaidinvoice} where you need your code to be displayed/printed hope this is what you are looking for, let me know if miss understand anything - - - Updated - - - <?php function hook_insideInvoice($vars){ # Place Your Code In This Variable $myCode = ""; if ($vars['filename']=="viewinvoice"){ if (isset($vars['status']) && $vars['status']=="Paid"){ return array("mycodepaidinvoice" => $myCode); } } } add_hook("ClientAreaPage", 1, "hook_insideInvoice"); ?> 1 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.