Jump to content

idevaffiliate code not working


neobug103

Recommended Posts

Modified code found on this forum:

$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 = "https://domain.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);

 

Does not display any errors in the checkout process, however it does not relay anything to idevaffiliate and therefore there is no commission created

 

Code created by idevaffiliate system:

$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=\"https://domain.com/affiliates/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid\" width=\"1\" height=\"1\">";

 

This code works and passes the variable to idevaffiliate and the commission is created however it loads a blank screen.

 

 

I am using the legacy order form on the newest version of WHMCS.

Link to comment
Share on other sites

the first method is the correct one and works perfectly

the 2nd method will screw up your order process as it will be outputting something which is not to be expected

is you serach the forums there are other threads on idev - we've had WHMCS and IDEV working for months using the curl method - check you do have curl installed :D

Link to comment
Share on other sites

idev gave me an updated version of that modified code and it worked for a little bit but now it still does not work and basically whmcs and idev say they can't fix the problem because they don't know what the problem is :S

 

The order goes through fine, no blank pages or error but idev never generated the commission

Link to comment
Share on other sites

Weird! I just checked our checkout script and we are using the one from iDev; just ran a test and had 5 orders today from affiliates; all went through correctly.

 

We have iDev setup to hold the new orders in a pending state until one of our Admin's verify the information for fraud. We also keep it as pending for 30 days in case the order is canceled.

 

here is the script that we have loaded:

 

<?php

$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.ourdomainname.com/idevaffiliate/sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid\" width=\"1\" height=\"1\">";

?>

Link to comment
Share on other sites

  • 3 weeks later...
  • 7 months later...
No, add to it the correct code which is found on this forum :)

 

So should I just add the code below to actionhooks.php?

I was using the code at http://www.idevdirect.com/whmcs.php but it stopped working after upgrading to 3.7.1 :(

 

$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 = "https://domain.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); 

 

Thanks ;)

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

Hello. I have the same problem. Both WHMCS and iDevAffiliates support points at the link http://www.idevdirect.com/whmcs.php, but after doing all described here, making a test purchase (I am not paying for order, I just accept it from admin panel), no any commission shown in idevs admin and user panels. What must I do? Maybe the thing that I don't pay for order causes this problem? Thanks:)

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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