mm1250 Posted December 16, 2007 Share Posted December 16, 2007 Hello, I have created the checkoutscript.php and uploaded it to the /includes folder. I also checked the box in the config page to run the script. I am using idev v5 and WHMCS v3.5 and when I put an order online for some reason the checkoutscript is not running. I am using the following code in the checkoutscript.php which is what I got form idev software. $idev_query = mysql_query("select amount from tblorders WHERE id='$orderid'"); $idev_query = mysql_fetch_array($idev_query); $idev_saleamt = $idev_query[amount]; print "<img border=\"0\" src=\"http://www.domain.com/affiliates/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid\" width=\"1\" height=\"1\">"; Also to note i'm using the new shopping cart if that might mean anything. What could be the problem that this is not working??? I know the cookies are on the machine i'm testing with so I'm a little lost. NEED HELP! 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted December 16, 2007 WHMCS CEO Share Posted December 16, 2007 When using the cart system, if you want to run code when the user checks out, you need to use the action hooks. See the manual for more details on these. Matt 0 Quote Link to comment Share on other sites More sharing options...
mm1250 Posted December 16, 2007 Author Share Posted December 16, 2007 Hello Matt, I have tried looking at the actionhook.php file but I'm a little lost as what I need to do. I'm not very knowledgeable in PHP programing. Could you guide us on the proper way to add the code in. Thanks, 0 Quote Link to comment Share on other sites More sharing options...
mm1250 Posted December 18, 2007 Author Share Posted December 18, 2007 Has ANYONE been able to get idevaffilates or ANY third party affiliate program to work with the new v3.5 cart.php order? I have tried everything and anything in the actiohooks.php and have not been able to get it to work. 0 Quote Link to comment Share on other sites More sharing options...
Webdomain.com Posted December 19, 2007 Share Posted December 19, 2007 Below is the code you'll have to use with iDevaffiliates. Simply edit the includes/actionhooks.php file. Find: function actionhook_ShoppingCartCheckout($vars) { # This function runs when the user checks out using the shopping cart # $vars["OrderID"] - Order ID Number # $vars["OrderNumber"] - 10 Digit Order Number # $vars["InvoiceID"] - Invoice ID Number # $vars["Products"] - Array of Product IDs from Order # $vars["Addons"] - Array of Addon IDs from Order # $vars["Domains"] - Array of Domain IDs from Order } and replace with: function actionhook_ShoppingCartCheckout($vars) { # This function runs when the user checks out using the shopping cart # $vars["OrderID"] - Order ID Number # $vars["OrderNumber"] - 10 Digit Order Number # $vars["InvoiceID"] - Invoice ID Number # $vars["Products"] - Array of Product IDs from Order # $vars["Addons"] - Array of Addon IDs from Order # $vars["Domains"] - Array of Domain IDs from Order $orderid = $vars["OrderID"]; $idev_query = mysql_query("select amount from tblorders WHERE id='$orderid'"); $idev_query = mysql_fetch_array($idev_query); $idev_saleamt = $idev_query['amount']; $site_url = "http://www.yourdomain.com/youridevaffiliatespath/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $site_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 100); $result = curl_exec($ch); curl_close($ch); } Note: Replace "www.yourdomain.com" by your own domain name and "youridevaffiliatepath" by your own iDevaffiliates installation path. 0 Quote Link to comment Share on other sites More sharing options...
dannygoh Posted May 23, 2008 Share Posted May 23, 2008 Below is the code you'll have to use with iDevaffiliates.Simply edit the includes/actionhooks.php file. function actionhook_ShoppingCartCheckout($vars) { # This function runs when the user checks out using the shopping cart # $vars["OrderID"] - Order ID Number # $vars["OrderNumber"] - 10 Digit Order Number # $vars["InvoiceID"] - Invoice ID Number # $vars["Products"] - Array of Product IDs from Order # $vars["Addons"] - Array of Addon IDs from Order # $vars["Domains"] - Array of Domain IDs from Order $orderid = $vars["OrderID"]; $idev_query = mysql_query("select amount from tblorders WHERE id='$orderid'"); $idev_query = mysql_fetch_array($idev_query); $idev_saleamt = $idev_query['amount']; $site_url = "http://www.yourdomain.com/youridevaffiliatespath/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $site_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 100); $result = curl_exec($ch); curl_close($ch); } Note: Replace "www.yourdomain.com" by your own domain name and "youridevaffiliatepath" by your own iDevaffiliates installation path. When putting the code in actionhook.php, i cannot get the commission to register with idev. i check the logs and the IP that run the "http://www.yourdomain.com/youridevaffiliatespath/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid" is my server IP and not my client IP? 202.xx.xx.228 - - [23/May/2008:08:41:56 +0800] "GET /idevaffiliate/sale.php?idev_saleamt=168.00&idev_ordernum=369 HTTP/1.1" 200 177 "-" "-" 0 Quote Link to comment Share on other sites More sharing options...
Emerson Posted May 29, 2008 Share Posted May 29, 2008 Same issue here. The sale is not registered in idev. No errors either. Anyone have a clue? Running: WHMCS 3.6.1 iDev 5.1 Thanks. 0 Quote Link to comment Share on other sites More sharing options...
Emerson Posted May 29, 2008 Share Posted May 29, 2008 Anyone else having issues see this: http://www.idevdirect.com/whmcs.php 0 Quote Link to comment Share on other sites More sharing options...
dannygoh Posted May 30, 2008 Share Posted May 30, 2008 Anyone else having issues see this: http://www.idevdirect.com/whmcs.php I have 95% of my client paying offline mode. The above solution only work for online payment (paypal / credit card) I need idev to capture my commission once the order has been make, after client make payment and i approved the commission manually. 0 Quote Link to comment Share on other sites More sharing options...
DF-Duncan Posted May 30, 2008 Share Posted May 30, 2008 We cannot get iDEV to work on the shopping cart order form using actionhooks, however it works well on the old order forms with the checkout script. We have been working with Jim at iDEV on this for ages, only to come to a halt as he is not able to find out why it does not work and has no idea on what is causing it to fail. 0 Quote Link to comment Share on other sites More sharing options...
dannygoh Posted May 30, 2008 Share Posted May 30, 2008 i like the cart system. i think i have to used back the order.php 0 Quote Link to comment Share on other sites More sharing options...
Emerson Posted May 30, 2008 Share Posted May 30, 2008 DF_Duncan, Did you use the method on the link I posted above? I got that directly from Jim yesterday. 0 Quote Link to comment Share on other sites More sharing options...
DF-Duncan Posted May 30, 2008 Share Posted May 30, 2008 DF_Duncan, Did you use the method on the link I posted above? I got that directly from Jim yesterday. Did not work for us unfort. 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.