Presta Shop

If you are using Presta shop as an e-commerce platform, then you will need to edit two files: controllers/front/OrderConfirmationController.php and themes/theme/order-confirmation.tpl

Replace the following placeholders with the program and order values:
CAMPAIGN_UNIQUE: you received it by e-mail
CONFIRM: you received it by e-mail
ADD_SALE_VALUE: the total paid value of the purchase minus all other expenses (like tax amount, discount amount, shipping cost)
ADD_DESCRIPTION: the name of all the products that have been purchased, URL-encoded. (This will help affiliates optimize future sales )
ADD_TRANSACTION ID: the order id, in your platform, URL-encoded. (This will help identify and process the commissions later)

In OrderConfirmationController.php you will need to add the following code, modified with your own variables and values:

<iframe height='1' width='1' scrolling='no' marginheight='0' marginwidth='0' frameborder='0' src='https://event.2performant.com/events/salecheck?amount={$total_products}&campaign_unique=YOUR_CAMPAIGN_UNIQUE_VALUE_FROM_TRACKING_CODE&confirm=YOUR_CONFIRM_VALUE_FROM_TRACKING_CODE&description={$description}&transaction_id={Tools::getvalue('id_order')}&'><iframe>

Example:

For an order of:
Items value: 121.54EUR
Discount: 12.15EUR
VAT: 21.88EUR VAT
Shipping: 15EUR
The order id in your platform: UY981237Y
Items description: “dress & necklace, shoes”

And supposing you received the following program parameters:
CAMPAIGN_UNIQUE=test_unique
CONFIRM=test_confirm

If you want to deduct VAT in the tracking code, you can add amount={$total_products/1.19} where 1.19 means that VAT is 19%. Bear in mind that VAT isn’t a stable percentage so this value can change.

In OrderConfirmationController.php add:

$order = new Order($this->id_order); $cart = new Cart($order->id_cart); $description=""; foreach ($cart->getProducts() AS $k=>$v) { $description.=$v['name']."X".$v['quantity']; } $description=urlencode($description); $this->context->smarty->assign(array( 'total_to_pay'=>$order->getOrdersTotalPaid(), 'total_products'=>$order->total_products_wt, 'description'=>$description ));

The store currency (EUR in our example) must be configured in 2Performant, in Settings/General and then choose Currency

Was this article helpful to you? Yes 1 No 1