SoftSmart.co.za Posted June 26, 2012 Share Posted June 26, 2012 Hi all, I have never worked with action hooks before, but I need to run some code now when an order is complete to do some split page testing... I got the example action hook in includes/hooks to send me an email when a new client registers, then I modified that code for the order complete hook, but that does not work (does not send me a mail). The code is: <?php /* ****************************************************** ** Example Hook Function ** Please refer to http://wiki.whmcs.com/Hooks for more info */ function hook_OrderComplete_HomePage_SplitTest($vars) { $orderid = $vars['orderid']; $ordernumber = $vars['ordernumber']; $invoiceid = $vars['invoiceid']; # Run code to create remote forum account here... $Message = "OrderID: ".$orderid."\r\nOrderNumber: ".$ordernumber."\r\nInvoiceID: ".$invoiceid."\r\nPageSplit: \r\n"; mail("john@softsmart.co.za", "NEW ORDER PAGE SPLIT TEST", $Message); } add_hook("ShoppingCartCheckoutCompletePage",1,"hook_OrderComplete_HomePage_SplitTest"); ?> This file is still in the same place (includes/hooks/example.php). Am I missing something? Is there something I need to put into one of the template files to call this hook? Thanks... John 0 Quote Link to comment Share on other sites More sharing options...
sham Posted April 4, 2013 Share Posted April 4, 2013 Hi all, I have never worked with action hooks before, but I need to run some code now when an order is complete to do some split page testing... I got the example action hook in includes/hooks to send me an email when a new client registers, then I modified that code for the order complete hook, but that does not work (does not send me a mail). The code is: <?php /* ****************************************************** ** Example Hook Function ** Please refer to http://wiki.whmcs.com/Hooks for more info */ function hook_OrderComplete_HomePage_SplitTest($vars) { $orderid = $vars['orderid']; $ordernumber = $vars['ordernumber']; $invoiceid = $vars['invoiceid']; # Run code to create remote forum account here... $Message = "OrderID: ".$orderid."\r\nOrderNumber: ".$ordernumber."\r\nInvoiceID: ".$invoiceid."\r\nPageSplit: \r\n"; mail("john@softsmart.co.za", "NEW ORDER PAGE SPLIT TEST", $Message); } add_hook("ShoppingCartCheckoutCompletePage",1,"hook_OrderComplete_HomePage_SplitTest"); ?> This file is still in the same place (includes/hooks/example.php). Am I missing something? Is there something I need to put into one of the template files to call this hook? Thanks... John Hi John Have, you managed to get this work? I'm sitting with a similar situation where the hook just doesn't seem to be executing. 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.