Avactis integration
Free PHP shopping cart software and Commercial open source shopping cart solution.
This integration menu uses Avactis interface for setting up the integration with Post Affiliate Pro.
1. Click tracking integration
First of all, you have to insert the click tracking code to your shop footer code. Navigate to Page manager, select a page you want to integrate with the click tracking code (all banner target pages) and click the edit link in the low Copyright section. Add the click tracking code into the “Block content” and click the Save button. Then click the lower “Save changes” button too.
2. Sale tracking in Avactis hosted version
Navigate to Page manager and select “order_placed.php” to be edited. Click “edit” link in center_column section for Last Placed Order block.
Add the following code right before “?>“:
// Post Affiliate Pro Tracking code snippet
$order_id = modApiFunc("Checkout", "getLastPlacedOrderID");
if(!empty($order_id)) {
$orderInfo = modApiFunc("Checkout", "getOrderInfo", $order_id, modApiFunc("Localization", "whichCurrencySendOrderToPaymentShippingGatewayIn", $order_id, GET_PAYMENT_MODULE_FROM_ORDER));
echo '<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">';
$i = 0;
foreach($orderInfo['Products'] as $product_info) {
$SKU = $product_info['SKU'];
$total = $product_info['SalePrice'] * $product_info['qty'];
$prod_name = $product_info['name'];
echo 'var sale'.$i.' = PostAffTracker.createSale();
sale'.$i.'.setTotalCost(\''.$total.'\');
sale'.$i.'.setOrderID(\''.$order_id.'\');
sale'.$i.'.setProductID(\''.$SKU.'\');
sale'.$i.'.setData1(\''.$prod_name.'\');';
$i++;
}
echo 'PostAffTracker.register();
</script>';
}
Save your work and that’s it.
3. Avactis with PayPal
In case you want to directly integrate PayPal which you use as a payment gateway in your Avactis, you have to do some special steps and also, it is only possible with Owned version of Avactis. The problem is you have to modify some files.
First, you have to add the ‘custom’ field and the tracking script into your paypal form – you can do it in file:
/avactis-themes/_your_theme_/checkout/checkout-sequence/default/confirmation_redirect_to_payment_gateway.tpl.html
IPN redirect code (cURL) goes to:
/avactis-system/modules/payment_module_paypal_cc/payment_module_paypal_cc_api.php
Use the codes form original PayPal integration method – it is the same.