mediademon Posted May 29, 2009 Share Posted May 29, 2009 Hi We have an actionhook for InvoicePaid which has now been migrated to V4. However, $vars["InvoiceID"] now only returns the first digit of the full invoice id number. Does anyone else use this hook and have the same issue? Kind regards 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted May 29, 2009 Share Posted May 29, 2009 (edited) Do... function name($invoiceid) { } Works for us Edited May 29, 2009 by atDev 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted May 29, 2009 Author Share Posted May 29, 2009 Thanks Ben, But how could you put this in context with the actionscript code? 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted May 29, 2009 Share Posted May 29, 2009 Sure, sorry, was in a hurry 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 3, 2009 Author Share Posted June 3, 2009 But how could you put this in context with the actionscript code? Any help appreciated! 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 4, 2009 Share Posted June 4, 2009 Sorry I guess I misunderstood your question. Are you still having trouble after my suggestion? 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 4, 2009 Author Share Posted June 4, 2009 Yes Ben, Not quite sure how to implement function name($invoiceid) {} within actionhooks.php. Could you elaborate? 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 4, 2009 Share Posted June 4, 2009 Unfortunately I am using v4 where all hooks go in /includes/hooks/ folder. I don't have a actionhooks.php file. 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 4, 2009 Author Share Posted June 4, 2009 me too! That's where my actionhooks.php lives... 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 4, 2009 Share Posted June 4, 2009 Ok sorry for the confusion. I suggest creating a single file for each hook. but ti would look like... <?php function do_something($invoiceid) { // You can then use $invoiceid in your code here } add_hook("InvoicePaid",1,"do_something",""); ?> 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 5, 2009 Author Share Posted June 5, 2009 Thanks Ben This helped a lot! 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 5, 2009 Author Share Posted June 5, 2009 ah - one last question, how would you include configuration.php in the hook? 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 5, 2009 Share Posted June 5, 2009 You shouldn't need to include configuration.php. Is there some variable you are trying to access? 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 5, 2009 Author Share Posted June 5, 2009 need to build a db connection string... 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 5, 2009 Share Posted June 5, 2009 To the WHMCS db? 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 5, 2009 Author Share Posted June 5, 2009 yes... it's to the local whmcs db 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 5, 2009 Share Posted June 5, 2009 Just use the full_query function. $result = full_query("SELECT * FROM tblclients"); 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 5, 2009 Author Share Posted June 5, 2009 We have an actionhook for InvoicePaid which has now been migrated to V4. However, $vars["InvoiceID"] now only returns the first digit of the full invoice id number. Does anyone else use this hook and have the same issue? Thanks for all your help so far, it seems that your code suffers from the same problem as mine! <?php function InvoicePaidEmail($invoiceid) { # This function runs when an invoice is fully paid $to = "info@mydomain.com"; $from = "info@mydomain.com"; $subject = "WHMCS Payment Received"; $headers = "To: ".$to."\n" . "From: ".$from."\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"; $message = "A new payment has been received for Invoice No.".$invoiceid."."; mail($to,$subject,$message,$headers); } add_hook("InvoicePaid",1,"InvoicePaidEmail",""); ?> The above code returns: A new payment has been received for Invoice No.5. When it should return: A new payment has been received for Invoice No.5432. Any ideas? 0 Quote Link to comment Share on other sites More sharing options...
atDev Posted June 5, 2009 Share Posted June 5, 2009 It looks right to me. Are you sure there is no other code truncating it? 0 Quote Link to comment Share on other sites More sharing options...
mediademon Posted June 5, 2009 Author Share Posted June 5, 2009 Thats the only hook in the file and there are no other hooks for InvoicePaid... Frustrating! 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted June 6, 2009 Share Posted June 6, 2009 invoice ID and invoice number are different. Do a db call to tblinvoices using $invoiceid and get the invoicenum from there to display the correct number. 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.