Shopping Carts from 3dCart are complete e-commerce storefront solutions for your new or existing web site. Easily build, edit, and maintain your online shop and collect orders without any programming or HTML knowledge!
This integration integrates template for 3DCart's thank you page.

NOTE: Your installation of Post Affiliate Pro must be available via HTTPS:// because the checkout happens in a secured page.

1.

Add sale tracking code

Go to Settings> Design> Themes & Styles> Under More button choose Edit Template (HTML) and edit file "checkout-step4.html" to add following code to the very end:

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();

var discount='[discounts]';
var splitDiscount = discount.split("$");
var numberDiscount = splitDiscount[1];

var total='[osubtotal]';
var splitTotal = total.split("$");
var numberTotal = splitTotal[1];
var TotalLessDiscount = numberTotal - numberDiscount;

sale.setTotalCost(TotalLessDiscount);
sale.setOrderID('[invoice-prefix][invoice-number]');

PostAffTracker.register();
</script>

If you need to add more information in sale tracking code, please refer to this guide on 3DCart: http://www.3dcart.com/guide/

To utilize the Coupons feature add right under sale.setOrderID('[invoice-prefix][invoice-number]'); the following:
sale.setCoupon('[coupon]');

2.

Product ID matching

If you want to track per product commissions, you have to use this integration code instead of the above one. The instructions are almost the same - edit the same file checkout-step4.html and add this code to the first line of the file:

<!-- PAP Integration snippet - part1 -->
<input type="hidden" id="itemNums" value="0">

<script id="pap_x2s6df8d" src="http://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>

<!-- checking if any discount (not gift certificate!) has been applied -->
<script type="text/javascript">
	var papItems = [];
	var discount = '[discounts]';
	var splitDiscount = discount.split('$');
	if (splitDiscount[1]>0) {
		var numberDiscount = splitDiscount[1];
	}
</script>
<!-- /PAP Integration snippet - part1 -->

Now find this line <!--START: items--> and add this code below it:

<!-- PAP Integration snippet - part2 -->
	<script type="text/javascript">
	var i = document.getElementById('itemNums').value;
	var iIncremented = ++i;
	document.getElementById('itemNums').value=iIncremented;

	var subTotal = '[subtotal]';
	var splitSubTotal = subTotal.split('$');
	subTotal = splitSubTotal[1];

	papItems[i-1] = {"subTotal":subTotal, "id":'[id]', "orderId":"[invoice-prefix][invoice-number]("+iIncremented+")"};
</script>
<!-- /PAP Integration snippet - part2 -->

The last part of the code goes to the very end of the same file:

<!-- PAP Integration snippet - part3 -->
<script type="text/javascript">
	var discountPerItem = 0;
	if (typeof numberDiscount != 'undefined') {
		discountPerItem = numberDiscount / document.getElementById('itemNums').value;
	}

	PostAffTracker.setAccountId('Account_ID');
	papItems.forEach(function (item, index) {
		var sale = PostAffTracker.createSale();
		sale.setTotalCost(item.subTotal - discountPerItem);
		sale.setOrderID(item.orderId);
		sale.setProductID(item.id);
		PostAffTracker.register();
	});
</script>
<!-- /PAP Integration snippet - part3 -->

The application will use product IDs defined in your 3DCart so you can easily check each product ID in Products > View

3.

Lifetime commissions

Tip: If you wish to utilize Lifetime Commissions, then in the checkout-step4.html file find the following line:

<td class="item">[oemail]</td>

and right below that line add this code:

<!-- Post Affiliate Pro integration snippet -->
<script type="text/javascript">
var customerEmail = '[oemail]';
</script>
<!-- Post Affiliate Pro integration snippet -->

The last step is to add this line into the sale tracking code:

sale.setData1(customerEmail);