Home
Integration Methods
ZenCart
Integration with ZenCart 1.3.8a and above is made by placing sale tracking script into the order confirmation page.
1
Edit template
To integrate ZenCart you should edit the order confirmation template. Open the file includes\templates\template_default\templates\tpl_checkout_success_default.php
2
Locate integration place
Find the line with following code which should already exist in the file.
<div id="checkoutSuccessOrderNumber"><?php echo TEXT_YOUR_ORDER_NUMBER . $zv_orders_id; ?></div>
3
Integration
Copy & Paste the following code into the file, under the line found above:
Ok, the integration is finished. Now every time a sale occurs, the shop will call our script and register the sale commission.
4
Lifetime commissions integration
If you want to integrate the Lifetime commissions plugin, then just add the code below into the code from step 3. after this line:
$orderId = $dbreq->fields['orders_id'];
Also you need to add this code: sale.setData1(\''.$email.'\');
right after the sale.setOrderID(\''.$orderId.'\');
In case you want to know the payment method name used in the order, you can use this variable:
$orders->fields['payment_method']
Integration PAP4 with Zen Cart 1.38
2 years ago
Matteo Wang
My PAP4 is Versione: 4.5.23.1, My E-SHOP is zen cart 1.38, but I can not integration them, I have to insert the code to the correct location, I inserted the code
<!-- Trace Post Affiliate Pro Bigin -->
<?php
$dbreq = $db->Execute("select * from ".TABLE_ORDERS_TOTAL." where orders_id = '".(int)$orders->fields['orders_id']."' AND class in ('ot_coupon', 'ot_gv', 'ot_subtotal', 'ot_group_pricing')");
while (!$dbreq->EOF) {
switch ($dbreq->fields['class']) {
case 'ot_subtotal': $order_subtotal = $dbreq->fields['value']; break;
case 'ot_coupon': $coupon_amount = $dbreq->fields['value']; break;
case 'ot_group_pricing': $group_pricing_amount = $dbreq->fields['value']; break;
case 'ot_gv': $gv_amount = $dbreq->fields['value']; break;
}
$dbreq->MoveNext();
}
$totalCost = ($order_subtotal - $gv_amount - $coupon_amount - $group_pricing_amount);
$totalCost = number_format($totalCost,2,'.','');
$orderId = $dbreq->fields['orders_id'];
// -------------products---------------------------------------------------------
$productId = "";
$dbreqa = $db->Execute("select products_id from ".TABLE_ORDERS_PRODUCTS." where orders_id = '".(int)$orders->fields['orders_id']."' ");
while (!$dbreqa->EOF) {
$productId = $dbreqa->fields['products_id'];
$dbreqa->MoveNext();
}
// ----------end products--------------------------------------------------------
print '<script id="pap_x2s6df8d" src="http://affiliates.zenmarket.biz/scripts/salejs.php" type="text/javascript"> </script>
<script type="text/javascript">
var sale = PostAffTracker.createSale();
sale.setTotalCost(\''.$totalCost.'\');
sale.setOrderID(\''.$orderId.'\');
sale.setProductID(\''.$productId.'\');
PostAffTracker.register();
</script>';
?>
<!-- Trace Post Affiliate Pro Over -->
But they can not trace to the commission of sale ,why? ?
Waiting for your answer, thank you
matteo wang