Webdomain.com Posted July 3, 2007 Share Posted July 3, 2007 We had some problems with the order process, namely a blank page was returned after step 5. It seems there is a slighty error in the step-by-step provided by iDevdirect to integrate iDevaffiliate with WHMCS. Hopefully and as always, Matt did a fantastic work to help us fixing this issue. As long as it may help some others, below is the correct step-by-step to integrate WHMCS in iDevAffiliate: 1. Login to your WHMCS. 2. Click on General Configuration - Other 3. Tick the box labeled : Run Script on CheckOut. 4. Save that setting and edit the /includes/checkoutscript.php file. Add the following code to that file. $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/affiliates/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); Where "yourdomain.com" have to be replaced by your own and "idevaffiliate_path" by the path to your own idevaffiliate script. After that, everything will work smoothly as it should. Enjoy. Link to comment Share on other sites More sharing options...
tracktor Posted July 3, 2007 Share Posted July 3, 2007 thanksSSSS Link to comment Share on other sites More sharing options...
MACscr Posted July 3, 2007 Share Posted July 3, 2007 how do you deal with cancellations and such? Link to comment Share on other sites More sharing options...
othellotech Posted July 4, 2007 Share Posted July 4, 2007 $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/affiliates/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); We just have ... $idev_saleamt = $amount; $idev_ordernum = $orderid; print "<img border=0 src=\"http://affiliates.othellotech.net/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$idev_ordernum\" width=1 height=1 alt=\"affiliate-image\">"; Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted July 4, 2007 WHMCS CEO Share Posted July 4, 2007 We just have ...$idev_saleamt = $amount; $idev_ordernum = $orderid; print "<img border=0 src=\"http://affiliates.othellotech.net/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$idev_ordernum\" width=1 height=1 alt=\"affiliate-image\">"; Yes, that's what you will have, that is what iDevAffiliate have been giving out to people, and that will break the order process. Matt Link to comment Share on other sites More sharing options...
Recommended Posts