Partner
An e-commerce extension for Joomla, has a wide range of marketing tools, but also powerful statistics displayable on your HikaShop dashboard to help you manage your store.
HikaShop is a Joomla! extension – have your users purchase your products efficiently, facilitate the management of your store, increase your sales thanks to built-in marketing tools and so much more!
The integration is does by inserting a tracking code to HikaShop file templates. You can track order subtotal, order ID, customer ID (for Lifetime commission).
Sale tracking code
Login to your Joomla! admin backend and navigate to Components >HikaShop >Display >Views and use filter for a quicker search – filter out the checkout view and the template you use. The template file we are looking for is after_end. Click it, you will be able to edit it from there.
At the end of this file, simply add this code:
/* Post Affiliate Pro integration snippet */
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->get($order_id);
$userClass = hikashop::get('class.user');
$user = $userClass->get($order->order_user_id);
echo '<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">'."
PostAffTracker.setAccountId('default1');
var sale = PostAffTracker.createSale();
sale.setTotalCost('".($order->order_full_price - $order->order_discount_price - $order->order_shipping_price)."');
sale.setOrderID('".$order->order_number."');
sale.setData1('".$user->user_email."');
PostAffTracker.register();
</script>";
/* /Post Affiliate Pro integration snippet */
Save your changes and you are done. It will track your sales now.
Alternative sale tracking code
If the above integration isn’t tracking for any reason then add the following code into the end file instead of the after_end file:
/* Post Affiliate Pro integration snippet */
$app = JFactory::getApplication();
$order_id = $app->getUserState(HIKASHOP_COMPONENT.'.order_id');
$orderClass = hikashop::get('class.order');
$order = $orderClass->get($order_id);
$userClass = hikashop::get('class.user');
$user = $userClass->get($order->order_user_id);
echo '<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">'."
PostAffTracker.setAccountId('default1');
var sale = PostAffTracker.createSale();
sale.setTotalCost('".($order->order_full_price - $order->order_discount_price - $order->order_shipping_price)."');
sale.setOrderID('".$order->order_number."');
sale.setData1('".$user->user_email."');
PostAffTracker.register();
</script>";
/* /Post Affiliate Pro integration snippet */
Do not forget to integrate your site with the click tracking code.