
1ShoppingCart Integration Guide
Learn how to integrate Post Affiliate Pro with 1ShoppingCart to enhance your eCommerce store's affiliate tracking, automate commissions, and streamline sales pr...
Integrate FoxyCart with Post Affiliate Pro to track transactions, coupons, and customer emails, leveraging features like Lifetime Commissions and product ID matching. Supports whole cart or individual product tracking for FoxyCart v2.0+.
Log into your FoxyCart store’s AdminPage, go to Templates > Receipt . In case there is no code yet, click to the FoxyCart Standard template .
Above the tag of the code of receipt template insert the following code:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
var ototal = '{{ total_order }}';
var odiscount = '{{ total_discount }}';
var oshipping = '{{ total_shipping }}';
var otax = '{{ total_tax }}';
var ofinalprice = ototal - odiscount - oshipping - otax;
PostAffTracker.setAccountId('default1');
var sale = PostAffTracker.createSale();;
sale.setTotalCost(ofinalprice);
sale.setOrderID('{{ order_id }}');
PostAffTracker.register();
</script>
Click the update template button and save your work.
For older versions of FoxyCart skip the rows that declare (define) the ‘ ototal ‘, …, ‘ ofinalprice ‘ variables and instead of these 2 lines of code:
sale.setTotalCost(ofinalprice);
sale.setOrderID('{{ order_id }}');
use these following in the code given in the box above:
sale.setTotalCost('^subtotal^');
sale.setOrderID('^order_id^');
If you wish to track the customer’s email address into the ‘Data1’ parameter of sale tracking code in order to utilize Lifetime Commissions , then right above:
PostAffTracker.register();
add the following code:
sale.setData1('{{ customer_email }}');
In older versions use ^customer_email^ instead of {{ customer_email }} .
In case you would like to use coupon tracking , use this version of code:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
<script type="text/javascript">
PostAffTracker.setAccountId('Account_ID');
var sale = PostAffTracker.createSale();
var coupon_code = "";
if(FC.json.hasOwnProperty('[coupons](https://www.postaffiliatepro.com/features/discount-coupons/ "Unlock the power of affiliate discount coupons with Post Affiliate Pro! Easily create, customize, and track coupons to boost brand promotion and sales. Ideal for individuals, start-ups, SMBs, and enterprises, our user-friendly software simplifies coupon management, enhancing affiliate marketing success. Explore how coupons can drive customer loyalty and satisfaction today!")')) {
$.each(FC.json.coupons, function(i, coupon){
if(coupon.name.search(/CS4/i) > -1) {
coupon_code = coupon.name;
}
});
}
var ototal = '{{ total_order }}';
var odiscount = '{{ total_discount }}';
var oshipping = '{{ total_shipping }}';
var otax = '{{ total_tax }}';
var ofinalprice = ototal - odiscount - oshipping - otax;
PostAffTracker.setAccountId('default1');
var sale = PostAffTracker.createSale();;
sale.setTotalCost(ofinalprice);
sale.setOrderID('{{ order_id }}');
sale.setCoupon(coupon_code);
PostAffTracker.register();
</script>
This option is available for FoxyCart version 2.0 and higher.
If you wish to take use of product id matching capability of Post Affiliate Pro, then you need to use a different integration code instead of the one mentioned in step no. 3.
Here is the code to be used:
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
{% set counter = 0 %}
{% for item in items %}
<script type="text/javascript">
PostAffTracker.setAccountId('deafult1');
var sale{{ counter }} = PostAffTracker.createSale();
sale{{ counter }}.setTotalCost('{{ item.price }}');
sale{{ counter }}.setProductID('{{ item.code }}');
sale{{ counter }}.setOrderID('{{ order_id }}_{{ counter }}');
sale{{ counter }}.setData1('{{ customer_email }}');
PostAffTracker.register();
</script>
{% set counter = counter + 1 %}
{% endfor %}
That’s it.
This option is available for FoxyCart version 2.0 and higher.
If you wish to utilize coupon tracking along with the per product tracking, then use the following code instead of the one in step no.5.
This option is available for FoxyCart version 2.0 and higher.
<script id="pap_x2s6df8d" src="https://URL_TO_PostAffiliatePro/scripts/trackjs.js" type="text/javascript"></script>
{% set counter = 0 %}
{% for item in items %}
<script type="text/javascript">
var coupon_code = "";
if(FC.json.hasOwnProperty('coupons')) {
$.each(FC.json.coupons, function(i, coupon){
if(coupon.name.search(/CS4/i) > -1) {
coupon_code = coupon.name;
}
});
}
PostAffTracker.setAccountId('deafult1');
var sale{{ counter }} = PostAffTracker.createSale();
sale{{ counter }}.setTotalCost('{{ item.price }}');
sale{{ counter }}.setProductID('{{ item.code }}');
sale{{ counter }}.setOrderID('{{ order_id }}_{{ counter }}');
sale{{ counter }}.setCoupon(coupon_code);
sale{{ counter }}.setData1('{{ customer_email }}');
PostAffTracker.register();
</script>
{% set counter = counter + 1 %}
{% endfor %}
If you wanted to track some more details into the Extra Data 2-5 fields of sale tracking code, check out the details available in the receipt template of foxycart:
https://wiki.foxycart.com/v/2.0/receipt
Foxycart supports twig syntax:
http://twig.sensiolabs.org/doc/templates.html
Foxy Cart is a versatile ecommerce platform designed to seamlessly integrate with existing websites or platforms. It offers a hosted cart and secure payment page, allowing businesses to sell a wide array of products, including physical items, digital downloads, subscriptions, and even accept donations. With support for over 90 payment gateways and multi-currency transactions, Foxy Cart provides a global solution for businesses that desire control over their website design and product management while leveraging robust ecommerce capabilities.
Founded in 2006, Foxy Cart emerged with the goal of reimagining the ecommerce experience. By 2007, it officially launched and quickly gained momentum, processing over $200 million in transactions by 2012. A significant milestone was the release of the Hypermedia API in 2015, which marked a major expansion of the platform’s capabilities and led to a rebranding simply as “Foxy.” Today, Foxy Cart continues to evolve, powered by a global team dedicated to enhancing ecommerce solutions for merchants and developers worldwide.
Foxy Cart is tailored for developers and technically skilled users who require a customizable and flexible ecommerce platform. It’s particularly suited for businesses comfortable working with HTML and API integrations. By offering the benefits of a locally hosted cart combined with the security and PCI compliance of a hosted checkout system, Foxy Cart appeals to those seeking a balance between control and convenience in their ecommerce operations.
Pros:
Cons:
Overall, users who have the technical prowess appreciate Foxy Cart for its secure and highly customizable platform, making it a preferred choice among developers seeking flexibility.
If you’re exploring other options, several platforms offer similar capabilities, each with its unique strengths:
Each of these alternatives caters to different preferences, whether you seek a turnkey solution or a platform that allows for extensive customization.
Foxy Cart is a versatile ecommerce platform designed to integrate with existing websites, offering a hosted cart and secure payment page for selling a wide range of products, supporting over 90 payment gateways and multi-currency transactions.
You can integrate Foxy Cart with Post Affiliate Pro by inserting tracking scripts into your receipt template, allowing you to track entire carts, individual products, coupon usage, and customer emails for Lifetime Commissions.
Yes, the integration allows you to track coupon codes and capture customer emails for features like Lifetime Commissions.
Foxy Cart is ideal for developers and technically skilled users who require a customizable, flexible ecommerce platform with robust integration options.
Foxy Cart offers Standard, Advanced, and Enterprise plans, with monthly billing starting at $21.25, as well as special offers for non-profits and a free unlimited trial.
Alternatives include Snipcart, Shoprocket, Shopify, Ecwid, Webflow, BigCommerce, WooCommerce, Adobe Commerce (Magento), Squarespace, and Wix.
Lucia is a talented content editor who ensures the seamless publication of content across multiple platforms.
Integrate Foxy Cart with Post Affiliate Pro for seamless affiliate tracking, advanced coupon features, and flexible cart solutions.
Learn how to integrate Post Affiliate Pro with 1ShoppingCart to enhance your eCommerce store's affiliate tracking, automate commissions, and streamline sales pr...
Would you like to improve your affiliate software even more? Check out the CS-Cart for Post Affiliate Pro.
Would you like to improve your affiliate software even more? Check out the BigCommerce integration for Post Affiliate Pro. Seamlessly track sales, manage commis...