Bitrain Posted December 25, 2007 Share Posted December 25, 2007 Below is the correct step-by-step to integrate WHMCS with Post Affiliate Pro: PS. I find what new version WHMCS 3.5.1 not have checkoutscript.php but have actionhooks.php I don't know why, but actionhooks.php not work for me. When I check box in "Configuration -> Other -> Run Script on CheckOut" and not make any changes in actionhooks.php I have on checkout a blank page. Well, here is steps: 1. Login to your WHMCS admin panel and check box "Run Script on CheckOut" in Configuration -> Other. 2. In your PAP admin panel go to "Tools -> Integration Wizard -> Step 2. Clicks tracking" 3. In "Clicks tracking" choice "new style". In field "Complete URL to main site" type your main URL, for example: http://www.yourdomain.com/index.php and put "Clicks tracking code" to your index.php page. 4. Create empty file checkoutscript.php and put insaid your new file this code: <?php $pap_query = mysql_query("select amount from tblorders WHERE id='$orderid'"); $pap_query = mysql_fetch_array($pap_query); $pap_saleamt = $pap_query['amount']; $pap_ordernum = $orderid; print "<img border=0 src=\"http://www.yourdomain.com/affiliate/scripts/sale.php?TotalCost=$pap_saleamt&OrderID=$pap_ordernum \"width=1 height=1 alt=\"affiliate-image\">"; ?> Change http://www.yourdomain.com/affiliate tou your location where PAP installed. 5. Upload your new checkoutscript.php to WHMCS_install_directory/includes After that configure your PAP and campaigns. It work fine for me. Hope this help you! 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted December 25, 2007 Share Posted December 25, 2007 PS. I find what new version WHMCS 3.5.1 not have checkoutscript.php but have actionhooks.php I don't know why, but actionhooks.php not work for me. actionhooks is for the cart processing, checkouscript for the order processing - which methiod are you using ? print "<img border=0 src=\"http://www.yourdomain.com/affiliate/scripts/sale.php?TotalCost=$pap_saleamt&OrderID=$pap_ordernum \"width=1 height=1 alt=\"affiliate-image\">"; A *VERY* bad idea as it will break the standard WHMCS processing The checkoutscript.php should NOT output anything. 0 Quote Link to comment Share on other sites More sharing options...
Bitrain Posted December 25, 2007 Author Share Posted December 25, 2007 othellotech It was solution for order processing. Now for using cart processing. 1. Open in editor your WHMCS_install_directory/include/actionhooks.php 2. After function actionhook_ShoppingCartCheckout($vars) { and before } add this code: $orderid = $vars["OrderID"]; $ord_num = $vars["OrderNumber"]; $pap_query = mysql_query("select amount from tblorders WHERE id='$orderid'"); $pap_query = mysql_fetch_array($pap_query); $pap_saleamt = $pap_query['amount']; $url = "http://www.yourdomain.com/affiliate/scripts/sale.php?TotalCost=$pap_saleamt&OrderID=$orderid&ProductID=$ord_num"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); $result = curl_exec($ch); curl_close($ch); Change http://www.yourdomain.com/affiliate tou your location where PAP installed. Hope this also helps integrate WHMCS with PAP 0 Quote Link to comment Share on other sites More sharing options...
vitolim Posted January 3, 2008 Share Posted January 3, 2008 Do u mean i just need to edit by follow your last post? or need to add your first post together? 0 Quote Link to comment Share on other sites More sharing options...
Bitrain Posted January 4, 2008 Author Share Posted January 4, 2008 Hi vitolim If you use cart processing method, then follow only my last post. 0 Quote Link to comment Share on other sites More sharing options...
rtartar Posted January 10, 2008 Share Posted January 10, 2008 This is good, I am not getting anything in the PAP, I look @ the web logs and do not see the curl calling? I ordered a product in the cart, paid, is actionhooks.php executed @ the completion of the order? Do I need to add anyting to the checkout script? thanks 0 Quote Link to comment Share on other sites More sharing options...
Bitrain Posted January 10, 2008 Author Share Posted January 10, 2008 Hi rtartar Depending on which processing method you have use, please follow my posts. All things work fine. PS. If you have a complexity you can PM me. 0 Quote Link to comment Share on other sites More sharing options...
mysmallbizu Posted January 14, 2008 Share Posted January 14, 2008 I"m using PAYPAL, and am wondering if the placement .... in checkout variables mean that the recurring sales are not triggered in PAP or cancelled for that matter? 0 Quote Link to comment Share on other sites More sharing options...
rtartar Posted January 15, 2008 Share Posted January 15, 2008 I don't know what my problem is? I can't seem to get this to work. I can get it to work with the client side javascript, but not the curl. I would really like to get the curl to work. 0 Quote Link to comment Share on other sites More sharing options...
vitolim Posted January 16, 2008 Share Posted January 16, 2008 hi Bitrain& guys, where and how do i input the sales tracking code into whmcs? after i follow Bitrain last post? thanks you 0 Quote Link to comment Share on other sites More sharing options...
vitolim Posted January 23, 2008 Share Posted January 23, 2008 Hi, I face some problem hope can help. I have done all implementation and created campain for it but, after try purchased, the affiliate cannot get commission but only click calculation. any idea? 0 Quote Link to comment Share on other sites More sharing options...
vitolim Posted February 23, 2008 Share Posted February 23, 2008 now i hear that v3.6 more easy to implement external affiallite program, but i log in to control panel where to add in? any one can help? and refer to my last post i still hving problem really dont know how to solve it. anyone help pls.. 0 Quote Link to comment Share on other sites More sharing options...
mysmallbizu Posted March 7, 2008 Share Posted March 7, 2008 After adding the code as suggested, PAP tracks BUT othellotech It was solution for order processing. Now for using cart processing. 1. Open in editor your WHMCS_install_directory/include/actionhooks.php 2. After function actionhook_ShoppingCartCheckout($vars) { and before } add this code: $orderid = $vars["OrderID"]; $ord_num = $vars["OrderNumber"]; $pap_query = mysql_query("select amount from tblorders WHERE id='$orderid'"); $pap_query = mysql_fetch_array($pap_query); $pap_saleamt = $pap_query['amount']; $url = "http://www.yourdomain.com/affiliate/scripts/sale.php?TotalCost=$pap_saleamt&OrderID=$orderid&ProductID=$ord_num"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); $result = curl_exec($ch); curl_close($ch); Change http://www.yourdomain.com/affiliate tou your location where PAP installed. Hope this also helps integrate WHMCS with PAP The client sees a blank white screen instead of being sent to the appropriate gateway. Internally the order is being processes, but payment isn't. Any suggestions? 0 Quote Link to comment Share on other sites More sharing options...
unitminer Posted April 6, 2009 Share Posted April 6, 2009 Integration with latest version of Post Affiliate PRo 4 is described here: http://addons.qualityunit.com/integration-methods/_iwhmcs/ 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.