Shopping Cart Integration
The guides below instruct on how to integrate AllAffiliatePro with your shopping cart. For PayPal integration See card processor integration, for Actinic integration see Actinic Ecommerce.
- osCommerce
Add the following code to checkout_process.php above the line:-
// send emails to other people".////////////////////////////////
/// AllAffiliatePro integration
////////////////////////////////$OrderTotal = $currencies->format($cart->show_total() - $total_tax);
$OrderID = $order_products_id;
tep_session_register('OrderTotal');
tep_session_register('OrderID');////////////////////////
/// AllAffiliatePro end
////////////////////////Add the following code within the HTML part of checkout_success.php (such as below the line <h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3>)
<!-- AllAffiliatePro Integration -->
<img src="http://www.YOURDOMAIN.com/cgi-bin/affiliate/clickme2.cgi?id=<?php echo $OrderID; ?>&amount=<?php echo $OrderTotal; ?>" height=1 width=1 border=0>
<?php
tep_session_unregister('OrderTotal');
tep_session_unregister('OrderID');
?><!-- AllAffiliatePro End -->
- aMemberPro
-
-Older versions
For recurring billing integration you must modify and edit the following files:-
Edit plugins\payment\paypal_r\paypal_r.inc.php search for the line:- global $config; Under which ADD the following line:- global $HTTP_COOKIE_VARS; Then search for the line:- 'custom' => $member_id, And REPLACE this line with:- //////////////////////// AllAffiliatePro tracking change
// old 'custom' => $member_id,
'custom' => $member_id.'-'.$HTTP_COOKIE_VARS['AFFILIATE'].'-'.$_SERVER['REMOTE_ADDR'].'-'.$HTTP_COOKIE_VARS['AFFILIATEREF'].'-'.$HTTP_COOKIE_VARS['site'].'-'.$HTTP_COOKIE_VARS['site_'],
//////////////////////// AllAffiliatePro tracking changeEdit plugins\payment\paypal_r\ipn.php
Search for the line:- $payer_email = $vars['payer_email']; Under which ADD the following lines:-//////////////////////// AllAffiliatePro tracking change
$custom_var = $vars['custom'];
list($cust_memid, $cust_affiliate, $cust_ip, $cust_ref, $cust_site, $cust_site_) = preg_split('/-/', $custom_var);$pathtoclick2 = "http://www.YOURDOMAIN.com/cgi-bin/clickme2.cgi?want=click2";
$query = "username=" . $cust_affiliate . "&id=" . $txn_id . "&amount=" . $payment_gross . "&IP=" . $cust_ip . "&ar=0&AFFILIATEREF=" . $cust_ref . "&site=" . $cust_site . "&site_=" . $cust_site_;
$header .= "POST $pathtoclick2 HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($query) . "\r\n\r\n";
$fp = fsockopen ('www.YOURDOMAIN.com', 80, $errno, $errstr, 30);
if (!$fp)
{
// HTTP ERROR
}
else
{
fputs ($fp, $header . $query);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
} // End loop
}
fclose($fp);//////////////////////// AllAffiliatePro tracking change
Be sure you swap BOTH occurances of YOURDOMAIN with your actual domain name.-Newer versions
For recurring billing integration you must modify and edit the following files:-
Edit plugins\payment\paypal_r\paypal_r.inc.php search for the lines:- function do_recurring_bill($amount, $title, $products, $u, $invoice){ And:- function do_not_recurring_bill($amount, $title, $products, $u, $invoice){ Under both ADD the following line:-
global $HTTP_COOKIE_VARS; Then search for the lines that contain:-
'custom'
And REPLACE these lines with:- //////////////////////// AllAffiliatePro tracking change
// old 'custom' => '',
'custom' => $HTTP_COOKIE_VARS['AFFILIATE'].'-'.$_SERVER['REMOTE_ADDR'].'-'.$HTTP_COOKIE_VARS['AFFILIATEREF'].'-'.$HTTP_COOKIE_VARS['site'].'-'.$HTTP_COOKIE_VARS['site_'],
//////////////////////// AllAffiliatePro tracking change Now search for the lines:-
function process_not_recurring_postback($vars){ And:-
function process_recurring_postback($vars){ Within the {} for those functions, just above 'return true;' ADD the following lines:-
//////////////////////// AllAffiliatePro tracking change
$custom_var = $vars['custom'];
list($cust_affiliate, $cust_ip, $cust_ref, $cust_site, $cust_site_) = preg_split('/-/', $custom_var);$pathtoclick2 = "http://www.YOURDOMAIN.com/cgi-bin/clickme2.cgi?want=click2";
$query = "username=" . $cust_affiliate . "&id=" . $txn_id . "&amount=" . $payment_gross . "&IP=" . $cust_ip . "&ar=0&AFFILIATEREF=" . $cust_ref . "&site=" . $cust_site . "&site_=" . $cust_site_;
$header .= "POST $pathtoclick2 HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($query) . "\r\n\r\n";
$fp = fsockopen ('www.YOURDOMAIN.com', 80, $errno, $errstr, 30);
if (!$fp)
{
// HTTP ERROR
}
else
{
fputs ($fp, $header . $query);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
} // End loop
}
fclose($fp);//////////////////////// AllAffiliatePro tracking change
Be sure you swap BOTH occurances of YOURDOMAIN with your actual domain name.