How to setup a Cart66 (WordPress shopping cart plugin)Affiliate Program


Cart66 is a most secure and sophisticated approached ecommerce platform for WordPress. Cart66 is the only ecommerce option in WordPress that supports PCI. Cart66 is well known for recurring billing handling and digital downloads selling. In a nutshell, you are using Cart66 servers to create carts for your products. So the cart itself is very robust. Cart66 is a nice option for online stores that covers almost anything you will need for your eCommerce store.

Steps

Step 1 - Landing Page

Add following code before </body> in your WP theme footer.php file
<script>
  var sd = 'YOUR-OSI-URL';
  var resource = document.createElement('script');
  resource.src = "YOUR-OSI-URL/track.js";  
  var script = document.getElementsByTagName('script')[0];
  script.parentNode.insertBefore(resource, script);
</script>

Change ‘YOUR-OSI-URL’ with your OSI URL.

Step 2 - Sales Code

This integration is very easy. You just need to edit the WP theme file ‘receipt.php’ at wp-content/plugins/cart66/views/

Find the following code line
if(Cart66Setting::getValue('enable_google_analytics') == 1 && $order->viewed == 0)

Now add following code above the mentioned line
?>
<script async>
    function hideIF() {    
        document.getElementById('IF').style.visibility = '';
    }
    function getSaleInfo() {
        document.getElementById('st_code').style.visibility = 'hidden';
        document.getElementById('st_code').innerHTML='<iframe src="YOUR-OSI-URL/sales/salejs/amount:<?php echo number_format($order->total, 2, ".", ""); ?>/transaction:<?php echo $order->trans_id; ?>" alt="" id=IF width=50 height=50 border="0" frameborder="0" onload="hideIF()">';
   }
   window.onload = getSaleInfo;
</script>
<div id="st_code"></div>
<?php


Change ‘YOUR-OSI-URL’ with your OSI URL.