uhhosting Posted May 6, 2008 Share Posted May 6, 2008 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? 0 Quote Link to comment Share on other sites More sharing options...
ckh Posted May 7, 2008 Share Posted May 7, 2008 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:// 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted May 7, 2008 Author Share Posted May 7, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted May 8, 2008 Share Posted May 8, 2008 the curl method is correct and works 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted May 8, 2008 Author Share Posted May 8, 2008 the curl method is correct and works What version of WHMCS have you tried it on? With 3.5.1 it does not work. 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted May 8, 2008 Share Posted May 8, 2008 3.4.x 3.5.x 3.6.0 works fine. the most common problem is adding extra whitespace at the end of the file 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted May 11, 2008 Author Share Posted May 11, 2008 Nope, still not working. According to the domains stats, WHMCS is able to access the iDev installation, but iDev is not registering the sale. 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted May 21, 2008 Author Share Posted May 21, 2008 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. 0 Quote Link to comment Share on other sites More sharing options...
kacy Posted January 24, 2009 Share Posted January 24, 2009 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? 0 Quote Link to comment Share on other sites More sharing options...
Emerson Posted May 23, 2009 Share Posted May 23, 2009 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! 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted June 18, 2009 Author Share Posted June 18, 2009 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. 0 Quote Link to comment Share on other sites More sharing options...
solokron Posted June 26, 2009 Share Posted June 26, 2009 How did that work out? I've only just moved over to v4, but will be testing this tomorrow. 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted June 26, 2009 Author Share Posted June 26, 2009 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} 0 Quote Link to comment Share on other sites More sharing options...
solokron Posted June 27, 2009 Share Posted June 27, 2009 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} 0 Quote Link to comment Share on other sites More sharing options...
uhhosting Posted June 27, 2009 Author Share Posted June 27, 2009 Modify the templates and simply remove the references to it. 0 Quote Link to comment Share on other sites More sharing options...
pji Posted July 19, 2009 Share Posted July 19, 2009 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? 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.