How to setup Freeway Affiliate Program



Freeway is a free open source online store ecommerce software solution for selling products and services online. It makes selling your services quick and easy. Freeway lets you to sell appointment, booking, subscription services, event ticketing as well as virtual and physical products.

Steps

Open the file checkout_success.tpl.php at file /templates/content and locate this line
<?php if(AFFILIATE_COMMISSION_JUNCTION=='true'){

Add the following code just before the mentioned line
<?php  
$sql = "SELECT orders_id FROM ".TABLE_ORDERS." WHERE customers_id='".(int)$customer_id."' ORDER BY date_purchased DESC LIMIT 1";
$ordes_qry = tep_db_query($sql);
$order = tep_db_fetch_array($ordes_qry);
$order_id = $order['orders_id'];
$sql = "SELECT value FROM ".TABLE_ORDERS_TOTAL." WHERE orders_id='".(int)$order_id."' AND class='ot_subtotal'";
$order_total_qry = tep_db_query($sql);
$order_total = tep_db_fetch_array($order_total_qry);
$total_val = $order_total['value'];
if($total_val != "" && $order_id != "")
{
    ?>
    <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 $total_val; ?>/transaction:<?php echo $order_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.