Jump to content

HOW TO: Configure iDevAffiliate for WHMCS


Recommended Posts

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

$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

  • WHMCS CEO
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

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated