Jump to content

iDevAffiliate problem


Recommended Posts

Hi,

 

I'm trying to intergrate iDevAffiliate 5 with WHMCS version 3.5.1.

 

Firstly, the file includes/checkoutscript.php didn't exist, I have created it and placed the following code in it:

 

<?php
$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.domain.com/partner//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);
?>

 

But this doesnt work. The order goes through correctly in WHMCS, but the sale isn't logged in iDv, despite iDev's control panel showing me the IP is logged and the session is valid.

 

Now, it did work using iDev's own code suggestion, which is:

 

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

]

 

However, when ordering your browser will throw up an error about serving non secure pages, the page then goes blank with a very tiny 1 pixel in dimension image box on the page.

 

The order goes through OK in WHMCS and the sale is logged in iDev, but both the error and the blank page are not desirable.

 

Does anyone have any recommendation's?

Link to comment
Share on other sites

You're going to get a 1 pixel by 1 pixel display because you are specifying it on your print line:

 

print "<img border=\"0\" src=\"http://www.domainname.com/partner//sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid\" width=\"1\" height=\"1\">";

 

You are going to get the unsecure error as you have a nonsecure hard link specified.

 

If it's on the same hosting account, just remove the http://www.domainname.com part so it just starts with /partner/sale.php.... Otherwise use https://

Link to comment
Share on other sites

You're going to get a 1 pixel by 1 pixel display because you are specifying it on your print line:

 

print "<img border=\"0\" src=\"http://www.domainname.com/partner//sale.php?idev_saleamt=$idev_saleamt&idev_ordernum=$orderid\" width=\"1\" height=\"1\">";

 

You are going to get the unsecure error as you have a nonsecure hard link specified.

 

If it's on the same hosting account, just remove the http://www.domainname.com part so it just starts with /partner/sale.php.... Otherwise use https://

 

Its not on the same account.

 

I added https last night and setup a test certificate on the site. But I still receive a blank page. The sale is registered, but the invoice is not displayed, it's just a blank page.

 

I read here:

 

http://forum.whmcs.com/showthread.php?t=4205&highlight=idevaffiliate

 

That the method iDev suggests actually breaks the order process, this is what I'm seeing. But the method suggested on that thread doesn't work for me either.

Link to comment
Share on other sites

  • 2 weeks later...

Cracked it - Not sure of the exact problem. Ended up installing idev in another location and using the following code:

 

{if $ispaid}
<img border="0" src="../../../../partner/sale.php?profile=72198&idev_saleamt={$amount}&idev_ordernum={$invoiceid}" width="1" height="1" />
{/if}

 

That needs to go into whmcsinstalldir/templates/orderforms/cart/complete.tpl

 

This time its installed on the same account as WHMCS itself.

Link to comment
Share on other sites

  • 8 months later...
Cracked it - Not sure of the exact problem. Ended up installing idev in another location and using the following code:

 

{if $ispaid}
<img border="0" src="../../../../partner/sale.php?profile=72198&idev_saleamt={$amount}&idev_ordernum={$invoiceid}" width="1" height="1" />
{/if}

 

That needs to go into whmcsinstalldir/templates/orderforms/cart/complete.tpl

 

This time its installed on the same account as WHMCS itself.

 

 

Hello :) Thank you for this.

Can you tell me what the

profile=72198 is?

 

I see where to place this code and do you think i can use a full URL or should you only use relative paths?

Link to comment
Share on other sites

  • 3 months later...

Sorry to dig up an old thread but I am having issues since upgrading to v4

 

<?php
$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.domain.com/partner//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);
?>

 

The above worked on v3.x but not on v4

Anyone have any ideas?

 

Thanks!

Link to comment
Share on other sites

  • 4 weeks later...
Sorry to dig up an old thread but I am having issues since upgrading to v4

 

<?php
$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.domain.com/partner//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);
?>

 

The above worked on v3.x but not on v4

Anyone have any ideas?

 

Thanks!

 

I've only just moved over to v4, but will be testing this tomorrow.

Link to comment
Share on other sites

How did that work out?

 

Hi, worked fine, tested it earlier today, using idev 6.0.1 and WHMCS 4.0.2.

 

Here's what I'm using:

 

{php}
$orderid = $this->get_template_vars('orderid');
$result = select_query("tblorders","amount",array("id"=>$orderid));
$data = mysql_fetch_array($result);
$amount = $data["amount"];
$this->assign('amount',$amount);
{/php}
<img src="../../../../partner/sale.php?profile=33&idev_saleamt={$amount}&idev_ordernum={$orderid}&ip_address={$smarty.server.REMOTE_ADDR}" width="1" height="1" border="0" />

 

partner being the installation of idev, on the same domain as WHMCS.

 

It goes in templates/orderforms/cart/complete.tpl between:

 

{if $ispaid}

{/if}

Link to comment
Share on other sites

How does one disable the default whmcs affiliate system? I have it unchecked yet it still pops up on the index and other places.

 

Hi, worked fine, tested it earlier today, using idev 6.0.1 and WHMCS 4.0.2.

 

Here's what I'm using:

 

{php}
$orderid = $this->get_template_vars('orderid');
$result = select_query("tblorders","amount",array("id"=>$orderid));
$data = mysql_fetch_array($result);
$amount = $data["amount"];
$this->assign('amount',$amount);
{/php}
<img src="../../../../partner/sale.php?profile=33&idev_saleamt={$amount}&idev_ordernum={$orderid}&ip_address={$smarty.server.REMOTE_ADDR}" width="1" height="1" border="0" />

 

partner being the installation of idev, on the same domain as WHMCS.

 

It goes in templates/orderforms/cart/complete.tpl between:

 

{if $ispaid}

{/if}

Link to comment
Share on other sites

  • 4 weeks later...
Hi, worked fine, tested it earlier today, using idev 6.0.1 and WHMCS 4.0.2.

 

Here's what I'm using:

 

{php}
$orderid = $this->get_template_vars('orderid');
$result = select_query("tblorders","amount",array("id"=>$orderid));
$data = mysql_fetch_array($result);
$amount = $data["amount"];
$this->assign('amount',$amount);
{/php}
<img src="../../../../partner/sale.php?profile=33&idev_saleamt={$amount}&idev_ordernum={$orderid}&ip_address={$smarty.server.REMOTE_ADDR}" width="1" height="1" border="0" />

 

partner being the installation of idev, on the same domain as WHMCS.

 

It goes in templates/orderforms/cart/complete.tpl between:

 

{if $ispaid}

{/if}

 

Just curious - I use the same code and the order number for the commission is N/A, does it show for you?

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