Supercart integration
A Czech ecommerce solution.
This is integration method with Supercart (supercart.cz).
Edit thank you page file
The first step is to find file template/default/order_finish.php and add this code, e.g. to the end of the file:
<?php echo tpl('system/pap_tracking.php', array('order' => $order)); ?>
Save your changes.
Create the tracking file
As you can see, we’ve pointed the template file to a custom file in previous step. Now we have to create it.
Create a file pap_tracking.php in template/system/ directory and add this content to it:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
<?php
// $order['total_price']
$i = 1;
foreach($order->order_products() as $product) {
echo "var sale$i = PostAffTracker.createSale();";
echo "sale$i.setTotalCost('".$product['price'] * $product['quantity']."');";
echo "sale$i.setOrderID('".$order['id'].'('.$i.")');";
echo "sale$i.setProductID('".($product['sku'] ? $product['sku'] : $product['id'])."');";
$i++;
}
?>
PostAffTracker.register();
</script>
Save the file. In case you created it locally, please do not forget to upload it to template/system/. That’s it, your shop has just been integrated.
Do not forget to integrate you click tracking code – you can insert it to file template/default/footer.php