Jump to content

Help with iDevaffiliates


mm1250

Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 5 months later...
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 "-" "-"

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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