Presta Shop

An open source ecommerce software that helps to create a successful online stores for free.

1.Edit the file:

controllers/front/orderconfirmationcontroller.php

find this function initContent()

find this line$presentedOrder = $this->order_presenter->present($order);

Put this code below that line
$currency = new CurrencyCore($cookie->id_currency);
$my_currency_iso_code = $currency->iso_code;

And again find this line
$this->context->smarty->assign(array(

add this code below that line
‘currency’ => $my_currency_iso_code,

Save these files and continue with next step.

2.Code

Navigate your directory yourdirectory/themes/classic/templates/checkout/order-confirmation.tpl

find {/block} end of the file. And add below script code before {/block}

<script src="https://yourname.affberry.com/sales/sale.js" type="text/javascript"></script>
<script type="text/javascript">
var accountid ='5';
var campaignid='7';
var cost='{$order.products[0].original_product_price}';
var orderid='{$order.products[0].id_order}';
var productid='{$order.products[0].product_id}';
var currencycode ='{$currency}';
var pluginc='9';//dont change 
var trackurl = 'https://yourname.affberry.com/';
register(accountid,campaignid,cost,orderid,productid,currencycode,pluginc,trackurl);
</script>

And now just save it and you are ready to track the sales now.