Foxy Cart integration
A hosted e-commerce solution that was built specifically with web developers in mind.
How to integrate PostAffiliatePro with Foxy Cart
Login
Log into your FoxyCart store’s AdminPage, go to Templates > Receipt. In case there is no code yet, click to the FoxyCart Standard template.
Integration – track whole cart as one transaction
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 }} .
Coupon tracking
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')) {
$.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>
Integration – tracking each product as a separate transaction
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.
Integration – tracking each product as a separate transaction + coupon tracking
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
What is Foxy Cart?
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.
Key Features of Foxy Cart
- Unlimited Product Types: Sell physical goods, digital downloads, subscriptions, and accept donations without limitations.
- Payment Gateway Integration: Seamlessly connect with over 90 payment gateways and support multi-currency transactions to cater to an international customer base.
- Customizable Cart and Checkout: Personalize your cart and offer a streamlined, one-page checkout experience along with customized transaction emails.
- International Support: Benefit from multi-language capabilities and set up international tax configurations to comply with global regulations.
- Security and Compliance: Enjoy a fully hosted solution that’s PCI DSS compliant, ensuring secure transactions, with an API available for further integrations.
Foxy Cart Pricing Options
- Standard Plan: Priced at $21.25 per month when billed annually or $25 per month on a monthly basis, plus 20¢ per transaction.
- Advanced Plan: At $250 per month annually or $300 monthly, plus 5¢ per transaction, this plan offers advanced features for growing businesses.
- Enterprise Plan: Starting at $2000+ per month, this option provides custom integrations and dedicated support for large-scale operations.
- Special Offers: Foxy Cart offers discounts for non-profit organizations and a free unlimited trial for new users to explore the platform’s capabilities.
User Insights on Foxy Cart
Pros:
- Developer-Friendly: Ideal for those with technical skills, offering extensive customization and integration possibilities.
- Flexible Integration: Easily integrates with existing websites, providing a seamless ecommerce addition without overhauling your current setup.
- Modern Interface: Features a contemporary user interface that enhances both merchant and customer experiences.
Cons:
- Technical Expertise Required: Not the most beginner-friendly platform; it requires a level of technical knowledge to utilize fully.
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.
Alternatives to Foxy Cart
If you’re exploring other options, several platforms offer similar capabilities, each with its unique strengths:
- Snipcart: A customizable shopping cart solution that integrates with any website.
- Shoprocket: An easy-to-use ecommerce platform with quick integration.
- Shopify: A comprehensive ecommerce solution with a wide range of features and apps.
- Ecwid: An ecommerce platform that adds a store to any existing site.
- Webflow: A web design tool that includes ecommerce capabilities.
- BigCommerce: A scalable platform suitable for businesses of all sizes.
- WooCommerce: A WordPress plugin that turns your site into an online store.
- Adobe Commerce (Magento): A powerful ecommerce platform for enterprise-level businesses.
- Squarespace: A website builder with integrated ecommerce functionalities.
- Wix: Offers easy-to-use website building tools with ecommerce options.
Each of these alternatives caters to different preferences, whether you seek a turnkey solution or a platform that allows for extensive customization.