Bachmann Trading Posted March 27, 2014 Share Posted March 27, 2014 Hi Vekia. I am sorry to say it is not working for me...but I guess it is me doing something wrong. Here is the affiliate iframe <!-- Offer Conversion: Whatbunkers.com - Poloer i høj kvalitet --> <iframe src="http://online.digital-advisor.com/aff_l?offer_id=314&amount=AMOUNT" scrolling="no" frameborder="0" width="1" height="1"></iframe> <!-- // End Offer Conversion --> I changed this to <!-- Offer Conversion: Whatbunkers.com - Poloer i høj kvalitet --> <iframe src="http://online.digital-advisor.com/aff_l?offer_id=314&amount={$total_products}" scrolling="no" frameborder="0" width="1" height="1"></iframe> <!-- // End Offer Conversion --> I added the below to orderconfirmationcontroller just before the line You specified. $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_products'=>$order->total_products(), 'description'=>$description )); 1) I want to send just product price excluding vat 2) also is there anyway I can always send the eur price even if the customer checks out with my other currency option Danish kroner? I hope You can help, I have a ton of products that i would like to sell :-) best regards Martin Link to comment Share on other sites More sharing options...
Bachmann Trading Posted March 28, 2014 Share Posted March 28, 2014 (edited) Anyone else want to give it a go? Edited March 28, 2014 by Bachmann Trading (see edit history) Link to comment Share on other sites More sharing options...
Alexgaw Posted May 15, 2014 Share Posted May 15, 2014 Hi Vekia I am having the same question on this mater. I want to add affiliate tracking on my site while using paypal module. I need to pass on the total order value without tax and shipping value but including any voucher or discount. How can this be done? Thank /Alex Link to comment Share on other sites More sharing options...
contempoweb Posted May 26, 2014 Share Posted May 26, 2014 I have a similar issue. I need to add the Commission Junction tracking pixel code: <img src="https://www.emjcd.com/u?AMOUNT=<AMOUNT>&DISCOUNT=<DISCOUNT>&CID=123456&OID=<OID>&TYPE=2345678&CURRENCY=USD&METHOD=IMG" height="1" width="20"> Where... <AMOUNT> = Subtotal (total_products) <OID> = Order ID (maybe this value: id_order_formatted) <DISCOUNT> = discounr amount How would I get those values into the tracking code above? Link to comment Share on other sites More sharing options...
vekia Posted May 26, 2014 Share Posted May 26, 2014 and what if order will not have discount? what kind of data provide then? Link to comment Share on other sites More sharing options...
dertypausz Posted June 27, 2014 Share Posted June 27, 2014 okay, so let's do the show ;-) open the file: controllers/front/OrderConfirmationController.php you've got there: $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); right before this code, paste this one: $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(), 'description'=>$description )); then in order-confirmation.tpl use: {$total_to_pay} instead the __ADD_SALE_VALUE__ {$description} instead the __ADD_DESCRIPTION__ save changes and try let me know if it works exactly as you expect regards hello vekia this works fine with 1.5.6.2 (affilinet), but price is WITH tax. if i change to total_products, it is WITHOUT tax, but also WITHOUT discounts. any ideas? thx in advance Link to comment Share on other sites More sharing options...
vekia Posted June 27, 2014 Share Posted June 27, 2014 the question is what kind of price you want to display? with tax? without tax? with discounts? without discounts? with delivery ? without? Link to comment Share on other sites More sharing options...
dertypausz Posted June 27, 2014 Share Posted June 27, 2014 hey price without delivery, without tax, but with discount Link to comment Share on other sites More sharing options...
tomped Posted August 20, 2014 Share Posted August 20, 2014 (edited) Hi Vekia, Have read trough this interesting thread, but couldn't find the answer I'm looking for. I'm looking for variables to put in this part of the code (will be placed on order-confirmation page): <script type="text/javascript">var vmt_pi = { ' shopId' : XXXX, 'type' : 'confirmed', 'amount' : 20.49, 'skus' : ['12345-05-WHT-XL', '12345-05-WHT-L', '12345-05-WHT-S'], 'prices' : [5.49,10.00,5.00] };</script> Marked in red (not solved): 'amount' = total net shopping cart value (excl. tax) 'skus' = comma separated list of the SKUs of the purchased products (I think I will use the product's reference here instead) 'prices' = comma separated list of the net prices in the same order Marked in green is static and no problems to insert. I'm using PS 1.6. Any ideas? Thanks in advance! Edited August 20, 2014 by tomped (see edit history) Link to comment Share on other sites More sharing options...
GS VISION Posted October 13, 2014 Share Posted October 13, 2014 In 1.6 I used vekia`s code and it worked, but made the cart add random prodcts alongside the really chosen one. Anyone got has thay issue,too? Link to comment Share on other sites More sharing options...
Guest Posted October 13, 2014 Share Posted October 13, 2014 (edited) Hi all, we successfully added tracking code on our website (prestashop 1.3.4.0).Now we would need only advise - in code we must write text for adding the following parameters: {Product-ID}{Product-IDs}{Price of Product}{Category Name}{Category ID}{Brand}{Related Product-IDs}{Product Quantities}{Order-ID}{Sale Amount} For last two (what are green) we know what we need write into code.{Order-ID} ---> {$id_order}{Sale Amount} ---> {$order->total_products}But on first eight not (red), is here someone who know code for this please? Thank you in advance for help. Edited October 13, 2014 by Guest (see edit history) Link to comment Share on other sites More sharing options...
ilisiaraul Posted October 27, 2014 Share Posted October 27, 2014 (edited) Here is it the right code for last versions 1.6.x.x. And thank you for this post really help after i write all day for codes.. I use it for my website http://sensuals.ro Pentru ID Comanda: {Tools::getvalue('id_order')} Pentru Descriptie: {$description} Pentru pretul total platit fara cost transport: {$total_products} - total pay withowt shipping Pret platit cu transport: {$total_to_pay} - total pay Pentru valori trebuie modificat /controllers/front/OrderConfirmationController.php - modify this with code below Imediat deasupra codului” $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); “trebuie pus acest cod: $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, 'description'=>$description )); Save and working 100%. Edited October 27, 2014 by ilisiaraul (see edit history) 1 Link to comment Share on other sites More sharing options...
lavalava Posted December 17, 2014 Share Posted December 17, 2014 Hi Vekia, I have to add this code in order-confirmation.tpl for my affiliate program: <script type="text/javascript"> var purchase = new AttrPurchase(); purchase.setMerchantId('**************************'); purchase.setOrderId('ORDER_ID'); purchase.setTotalCost(ORDER_TOTAL); purchase.register(); </script> Can I use your metod here and how to use variable here - for order_id and order_total (without tax and shipping) PrestaShop 1.5.4.1 Thank you! Link to comment Share on other sites More sharing options...
kk_yeow Posted January 16, 2015 Share Posted January 16, 2015 I have followed the instruction but the affiliate side did not received the order, I am using prestashop version 1.6 and the payment mode i am using paypal version 3.81. Link to comment Share on other sites More sharing options...
AZC Posted February 5, 2015 Share Posted February 5, 2015 okay, so let's do the show ;-) open the file: controllers/front/OrderConfirmationController.php you've got there: $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); right before this code, paste this one: $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(), 'description'=>$description )); then in order-confirmation.tpl use: {$total_to_pay} instead the __ADD_SALE_VALUE__ {$description} instead the __ADD_DESCRIPTION__ save changes and try let me know if it works exactly as you expect regards in 1.4.9 I have this in orderconfirmationcontroller.php public function displayContent() { parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl'); } } where would i put the above code? Link to comment Share on other sites More sharing options...
AZC Posted February 5, 2015 Share Posted February 5, 2015 awesome you see there variables: [total_paid] => 37.00 [total_paid_real] => 37.00 [total_products] => 30.83 [total_products_wt] => 37.00 [total_shipping] => 0.00 [total_wrapping] => 0.00 you can use in the .tpl file variables like: $order->total_paid - it will show: 37.00 $order->total_paid_real - it will show 37.00 $order->total_products - it will show 30.83 $order->total_products_wt- it will show 37.00 $order->total_shipping - it will show 0.00 $order->total_wrapping - it will show 0.00 now you can put one of them to the tracking pixel code i got this Order Object ( [id_address_delivery] => [id_address_invoice] => [id_cart] => [id_currency] => [id_lang] => [id_customer] => [id_carrier] => [secure_key] => [payment] => [module] => [conversion_rate] => [recyclable] => 1 [gift] => 0 [gift_message] => [shipping_number] => [total_discounts] => [total_paid] => [total_paid_real] => [total_products] => [total_products_wt] => [total_shipping] => [carrier_tax_rate] => [total_wrapping] => [invoice_number] => [delivery_number] => [invoice_date] => [delivery_date] => [valid] => [date_add] => [date_upd] => [tables:protected] => Array ( [0] => orders ) [fieldsRequired:protected] => Array ( [0] => conversion_rate [1] => id_address_delivery [2] => id_address_invoice [3] => id_cart [4] => id_currency [5] => id_lang [6] => id_customer [7] => id_carrier [8] => payment [9] => total_paid [10] => total_paid_real [11] => total_products [12] => total_products_wt ) [fieldsValidate:protected] => Array ( [id_address_delivery] => isUnsignedId [id_address_invoice] => isUnsignedId [id_cart] => isUnsignedId [id_currency] => isUnsignedId [id_lang] => isUnsignedId [id_customer] => isUnsignedId [id_carrier] => isUnsignedId [secure_key] => isMd5 [payment] => isGenericName [recyclable] => isBool [gift] => isBool [gift_message] => isMessage [total_discounts] => isPrice [total_paid] => isPrice [total_paid_real] => isPrice [total_products] => isPrice [total_products_wt] => isPrice [total_shipping] => isPrice [carrier_tax_rate] => isFloat [total_wrapping] => isPrice [shipping_number] => isUrl [conversion_rate] => isFloat ) [webserviceParameters:protected] => Array ( [objectMethods] => Array ( [add] => addWs ) [objectNodeName] => order [objectsNodeName] => orders [fields] => Array ( [id_address_delivery] => Array ( [xlink_resource] => addresses ) [id_address_invoice] => Array ( [xlink_resource] => addresses ) [id_cart] => Array ( [xlink_resource] => carts ) [id_currency] => Array ( [xlink_resource] => currencies ) [id_lang] => Array ( [xlink_resource] => languages ) [id_customer] => Array ( [xlink_resource] => customers ) [id_carrier] => Array ( [xlink_resource] => carriers ) [module] => Array ( [required] => 1 ) [invoice_number] => Array ( ) [invoice_date] => Array ( ) [delivery_number] => Array ( ) [delivery_date] => Array ( ) [valid] => Array ( ) [current_state] => Array ( [getter] => getCurrentState [setter] => setCurrentState [xlink_resource] => order_states ) ) [associations] => Array ( [order_rows] => Array ( [resource] => order_row [setter] => [virtual_entity] => 1 [fields] => Array ( [id] => Array ( ) [product_id] => Array ( [required] => 1 ) [product_attribute_id] => Array ( [required] => 1 ) [product_quantity] => Array ( [required] => 1 ) [product_name] => Array ( [setter] => ) [product_price] => Array ( [setter] => ) ) ) ) ) [table:protected] => orders [identifier:protected] => id_order [_taxCalculationMethod:protected] => 0 [id] => [fieldsSize:protected] => Array ( ) [fieldsRequiredLang:protected] => Array ( ) [fieldsSizeLang:protected] => Array ( ) [fieldsValidateLang:protected] => Array ( ) [image_dir:protected] => [image_format:protected] => jpg ) 1 now what? Link to comment Share on other sites More sharing options...
kk_yeow Posted February 9, 2015 Share Posted February 9, 2015 dear vekia.i am using prestashop v1.6 with paypal module as payment gateway , i follow the steps as below but but my affiliate did not received the order.Below are the steps that i have done. $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); right before this code, i paste this one: $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, 'description'=>$description )); THEN i paste my affiliate tracking pixel at the bottom of the code under themes/my_theme/order-confirmation.tpl <iframesrc="https://affinatestore.go2cloud.org/aff_l?offer_id=40&adv_sub={Tools::getvalue(id_order')}&amount={$total_products}" width="1" height="1" /> These are the steps i have done and the affiliate side did not received the order and i am using paypal as the only payment gateway.I need help urgently.Thanks Link to comment Share on other sites More sharing options...
kk_yeow Posted February 10, 2015 Share Posted February 10, 2015 anyone will know how to resolve this problem?or is it the affiliate tracking pixel i should paste somewhere else due to paypal redirect the link? Link to comment Share on other sites More sharing options...
AZC Posted February 10, 2015 Share Posted February 10, 2015 Hi, after long time searching I found this topic. I use Prestashop 1.4.7 and want to place a conversion pixel. but get a white page as order-confirmation-page In OrderconfirmationController.php I have: { $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_products'=>$order->total_products_wt, 'description'=>$description )); parent::displayContent(); self::$smarty->display(_PS_THEME_DIR_.'order-confirmation.tpl'); } } And in order-confirmation.tpl I have the pixel and variables <img src="http://www.site.nl/kleding/conversion.php?campaignID=14519&productID=21572&conversionType=sales&https=0&transactionID={Tools::getvalue('id_order')}_formatted&transactionAmount='{$total_to_pay}'&email=email&descrMerchant={$description}&descrAffiliate={$description}" width="1" height="1" border="0" alt="" /> But when I make an order, I get a blank page instead of the last step of the orderproces (order-confirmation.php). The error I get when I turn on error-reporting: Fatal error: Call to a member function assign() on a non-object in/home/ufiqlaxk/domains/site.nl/public_html/controllers/OrderConfirmationController.php on line 93 Probably not only the code I placed on line 93 ($this->context->smarty->assign(array( ) isn't right, also the conversion image variables may not be right I guess. Can you help me out? did you sort this out? Link to comment Share on other sites More sharing options...
xiaochunn Posted February 15, 2015 Share Posted February 15, 2015 (edited) Im getting this error, after pasting the code in order confirmation tpl. anyone know whats the issue? Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "/home/public_html/themes/default-bootstrap/order-confirmation.tpl" on line 62 "window._fbq.push(['track', 'xxxx', {'value':'0.01','currency':'USD'}]);" - Unexpected ":", expected one of: "}" <-- thrown in /home/public_html/tools/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 62 Edited February 15, 2015 by xiaochunn (see edit history) Link to comment Share on other sites More sharing options...
Attrexx Posted March 18, 2015 Share Posted March 18, 2015 (edited) Thank you Vekia for this quick, clean and helpful intervention. My code works nicely after following the instructions here. But my code has one more variable (we work with the same affiliate program: "2parale").I made a separate thread for it, but because it's closely tied to this one, I will write here the problematic variable for redirecting others who, like me, have an incomplete tracking code.So if anyone has a mind block with the __ADD_AFFILIATE_SALE_COMMISSION_PERCENT__ variable, there is another thread for it (or maybe an admin can merge threads?) : https://www.prestashop.com/forums/topic/430862-variable-sale-commission-percent-in-affiliate-tracking-code/?p=2007089 Edited March 18, 2015 by Attrexx (see edit history) Link to comment Share on other sites More sharing options...
YiannisK Posted April 30, 2015 Share Posted April 30, 2015 In order to substract the discount from $total_products I used the following code /************************** AFFILIATE NETWORK SCRIPT VALUES ****************************/ $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); $total_wt_disc = round(($order->total_products - $order->total_discounts) , 2); $this->context->smarty->assign(array( 'total_to_pay'=>$order->getOrdersTotalPaid(), 'total_products'=>$total_wt_disc, 'description'=>$description )); /************************** AFFILIATE NETWORK SCRIPT VALUES END ****************************/ Link to comment Share on other sites More sharing options...
kalua Posted May 4, 2015 Share Posted May 4, 2015 Hey Vekia I also have some problems with the trackingcodes, but it seems that the variables from 1.3 or 1.5 did not work on 1.6.0.11 What I get is the order ID with {Tools::getvalue(id_order')} but i absolutly can't get the value of the total products ... not with oder even not without tax. What I need is the total amount of the products without taxes and without shipping and also the variable of the currency because the shop is running in EUR and U$ Any hint for me? Link to comment Share on other sites More sharing options...
YiannisK Posted May 4, 2015 Share Posted May 4, 2015 We just added paypal as payment gateway. The script does not work with paypal. Any help? Link to comment Share on other sites More sharing options...
kalua Posted May 4, 2015 Share Posted May 4, 2015 Update: Just fixed the total amount without tax and shipping, but searching for how to get the currency out there. For PayPal, i haven't tested it, but i think it's clear that it is not working this way because after going out to payPal, the orderconfirmationcontroller.php can't delivery the datas. joss54 - i think we have to store the data in a cookie ... ??? Link to comment Share on other sites More sharing options...
kalua Posted May 5, 2015 Share Posted May 5, 2015 I'am getting closer to the problem and also fixed the problem with the currency. I can get it out with {$currency->iso_code} But the problem with paypal is somewhere else. I just made a testorder via paypal and the final page wil be like this: ..../de/module/paypal/submit?key=c5842c59... I took a look at the controllers in the paypal module and there is a reference to the order-confirmation.tpl ... take a look: if ($this->context->getMobileDevice() == true) $this->setTemplate('order-confirmation-mobile.tpl'); else $this->setTemplate('order-confirmation.tpl'); } related to this I change the code like vekia said before in the OrderConfirmationController.php to this in the submit.php in Paypal. if ($this->context->getMobileDevice() == true) $this->setTemplate('order-confirmation-mobile.tpl'); else $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); $total_wt_disc = round(($order->total_products - $order->total_discounts) , 2); $this->context->smarty->assign(array( 'total_to_pay'=>$order->getOrdersTotalPaid(), 'total_products'=>$total_wt_disc, 'description'=>$description )); $this->setTemplate('order-confirmation.tpl'); } But I did not get any data out?? Any idea to that? Link to comment Share on other sites More sharing options...
YiannisK Posted May 6, 2015 Share Posted May 6, 2015 (edited) EDIT: FOUND THE SOLUTION Go to /modules/paypal/views/templates/front/order-confirmation.tpl and put your affiliate tracking code. Mine is like: <script type="text/javascript"> affiliate.load_action("11628", "{Tools::getvalue('id_order')}", "1::{$total_products_wt}", "", "pending"); </script> Then go to /modules/paypal/controllers/front/submit.php near line 67, says $price = Tools::convertPriceFull($paypal_order['total_paid'], $order_currency, $display_currency); at the next line insert (prices include tax and subtract discounts) $total_products_wt = round(($order->total_products_wt - $order->total_discounts), 2); and also at the next array (lines 72-80) put one more line to send to tpl. 'total_products_wt' => $total_products_wt, This is it! I'am getting closer to the problem and also fixed the problem with the currency. I can get it out with {$currency->iso_code} But the problem with paypal is somewhere else. I just made a testorder via paypal and the final page wil be like this: ..../de/module/paypal/submit?key=c5842c59... I took a look at the controllers in the paypal module and there is a reference to the order-confirmation.tpl ... take a look: if ($this->context->getMobileDevice() == true) $this->setTemplate('order-confirmation-mobile.tpl'); else $this->setTemplate('order-confirmation.tpl'); } related to this I change the code like vekia said before in the OrderConfirmationController.php to this in the submit.php in Paypal. if ($this->context->getMobileDevice() == true) $this->setTemplate('order-confirmation-mobile.tpl'); else $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); $total_wt_disc = round(($order->total_products - $order->total_discounts) , 2); $this->context->smarty->assign(array( 'total_to_pay'=>$order->getOrdersTotalPaid(), 'total_products'=>$total_wt_disc, 'description'=>$description )); $this->setTemplate('order-confirmation.tpl'); } But I did not get any data out?? Any idea to that? Edited October 3, 2016 by joss54 (see edit history) Link to comment Share on other sites More sharing options...
skinnybloke Posted June 5, 2015 Share Posted June 5, 2015 (edited) in addition, i tested it also in 1.6.0.4 release - it works too so, conclusion is simple, we have got universal solution Hi - Does this work in v1.6.0.14 I have tried this solution and if I look in firebug I get the error '$total_to_pay is not defined' from order-confirmation.tpl I have inserted 'var_dump('testing');' in order-confirmation.php to ensure that the overriden php file is processing and this displays correctly. Please ignore the above - it does work in v1.6.0.14 My problem was that I was trying to pass a Smart variable into javasxript using: var google_conversion_value = {$total_to_pay}; Whereby I should have been using: var google_conversion_value = {/literal}{$total_to_pay}{literal}; Edited June 5, 2015 by skinnybloke (see edit history) Link to comment Share on other sites More sharing options...
dolec Posted September 3, 2015 Share Posted September 3, 2015 (edited) How can i get Total Price with tax including discounts in 1.6.x.x? does this variable is with discounts? As i made some tests and i see it includes price drops.. $order->total_products_wt if not what variable is for discounts in controller as this code below always shows 0 is it right? $order->total_discounts Edited September 3, 2015 by dolec (see edit history) Link to comment Share on other sites More sharing options...
plusperformance Posted November 10, 2015 Share Posted November 10, 2015 (edited) I'm trying to implement the pixel since two days. I read the whole thread and followed the steps but it still doesn't work. It seems like pixel is not firing at all.Let me explain how it's implemented at the moment:/movokshop/prestashop/themes/newyork/order-confirmation.tpl:{capture name=path}{l s='Order confirmation'}{/capture}<img src="https://plus.go2cloud.org/aff_l?offer_id=3061&adv_sub={Tools::getvalue(id_order')}&amount={$total_products}" width="1" height="1" /><h1 class="page-heading title_font">{l s='Order confirmation'}</h1>{assign var='current_step' value='payment'}{include file="$tpl_dir./order-steps.tpl"}{include file="$tpl_dir./errors.tpl"}{$HOOK_ORDER_CONFIRMATION}{$HOOK_PAYMENT_RETURN}{if $is_guest} <p>{l s='Your order ID is:'} <span class="bold">{$id_order_formatted}</span> . {l s='Your order ID has been sent via email.'}</p> <p class="cart_navigation exclusive"> <a class="button-exclusive btn btn-default title_font" href="{$link->getPageLink('guest-tracking', true, NULL, "id_order={$reference_order|urlencode}&email={$email|urlencode}")|escape:'html':'UTF-8'}" title="{l s='Follow my order'}"><i class="icon-chevron-left"></i>{l s='Follow my order'}</a> </p> {else}<p class="cart_navigation exclusive"> <a class="button-exclusive btn btn-default title_font" href="{$link->getPageLink('history', true)|escape:'html':'UTF-8'}" title="{l s='Go to your order history page'}"><i class="icon-chevron-left"></i>{l s='View your order history'}</a></p>{/if} /movokshop/prestashop/controllers/front/OrderConfirmationController.php: $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(), 'description'=>$description )); $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); ......I would appreciate if you could take a look at the implementation and maybe figure out the problem. I think I made somewhere a big mistake as the affiliate don't see anything. There is no response from prestashop at all thats why I think that pixel is not firing. I'm using prestashop 1.6Looking forward to your response!Regards Edited November 10, 2015 by plusperformance (see edit history) Link to comment Share on other sites More sharing options...
MasterYan Posted December 29, 2015 Share Posted December 29, 2015 I'm using prestashop 1.6 as well, and while my code is work well, I'm trying to use an affiliate tracking program to optimize my stuff, and couldn't figure our how to set up prosper202 to prestashop. I just signed up for Clicker Ticker but I would prefer to use the free option. Link to comment Share on other sites More sharing options...
fireseo Posted January 27, 2016 Share Posted January 27, 2016 can anybody tell me which files need to change? i want to add sharesale Affiliate Tracking Code: my website: prestashop_1.6.1.1, and v3.10.2-PayPal Europe - Official. because the v1.3.9-PayPal USA & Canada has bug, no orders in BO via paypal standard payment, so i have to use v3.10.2-PayPal Europe. A: add Affiliate Tracking Code to : /modules/paypal/views/templates/front/order-confirmation.tpl /modules/paypal/controllers/front/submit.php or B: themes/theme/order-confirmation.tplcontrollers/front/OrderConfirmationController.php. Do i need set paypal IPN? i don't know which real IPN Return url? is this http://www.website/paypal/ipn.php ? or http://www.website/paypal/controllers/front/submit.php someone said paypal IPN return url set to : http://yoursitedomain.com/module/paypal/validation.php but i can't find this file in /module/paypal/ this mywebsite made payment url http://www.mywebsite.com/index.php?key=b153d2f78543a8450b67e17577dc665b&id_module=72&id_cart=15&id_order=10&fc=module&module=paypal&controller=submit @vekia thank you . Best, Link to comment Share on other sites More sharing options...
isbenj Posted February 5, 2016 Share Posted February 5, 2016 what to do if we use prestashop on the cloud and have only read access to controllers/ .... ? Link to comment Share on other sites More sharing options...
kovandap Posted February 8, 2016 Share Posted February 8, 2016 okay, so let's do the show ;-) open the file: controllers/front/OrderConfirmationController.php you've got there: $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); right before this code, paste this one: $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(), 'description'=>$description )); then in order-confirmation.tpl use: {$total_to_pay} instead the __ADD_SALE_VALUE__ {$description} instead the __ADD_DESCRIPTION__ save changes and try let me know if it works exactly as you expect regards Hi, can you please help me? I need this 'total_to_pay'=>$order->getOrdersTotalPaid() but my shop is in cloud, co i have no access to this controller, only to order_confirmation.tpl. I am asking help in this thread: https://www.prestashop.com/forums/topic/504273-putting-provision-tracking-code-to-confirmed-order-thank-you-page/?hl=%2Bcloud+%2Band+%2Btracking&do=findComment&comment=2247915 Link to comment Share on other sites More sharing options...
giulaiula Posted February 15, 2016 Share Posted February 15, 2016 hello thanks for information, so the affiliate network accept everything? Hello please help me and me with Traking code. I did all the steps of implementation but the code does not work Link to comment Share on other sites More sharing options...
planetediscount Posted March 7, 2016 Share Posted March 7, 2016 Hello Everything is working, thanks a lot for help. I just have 1 problem to get "voucher code" variable to put it in the tracking code. by voucher oce i mean car_rules code, like "12345". Can somebody know what to write in OrderConfirmationController.php Link to comment Share on other sites More sharing options...
trevorgilligan Posted April 5, 2016 Share Posted April 5, 2016 well done guys! hope you enjoyed the beer @vekia Link to comment Share on other sites More sharing options...
selectum Posted May 22, 2016 Share Posted May 22, 2016 Hi All, I need your help i have no experience on programming I followed your instructions and it looks like it worked. I need to add a level of complexity . I arranged with my affiliate network that for example if they help me to sell a premium product they will get lets say 10 percent but if is a basic product they will get 5 percent. this segmentation is the same as the category of the products.. but i have no idea how to get a total of sales of category one and the total of category two in one order, this is the code <img src="//action.metaffiliation.com/trk.php? mclic=IDKWANKO&argmon=AMOUNT&argann=EVENTID&standard=AMOUNT1&premium=AMOUNT2&argmodp=PAYNAME&nacur= CURRENCY" width="1" height="1" border="0" /> where Amount is the total of the order , event id is the order id, Amount1 is total of basic products and amount2 is total sales of premium products, I appreciate if you could help me, Thanks Link to comment Share on other sites More sharing options...
thabisomak Posted July 6, 2016 Share Posted July 6, 2016 (edited) Hi Guys I've tried using this solution (Version 1.6.1.4) When testing, the confirmation page returns blank. Can anyone help? Thanks Edited July 6, 2016 by thabisomak (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted September 27, 2016 Share Posted September 27, 2016 blank page = errors turn on error reporting and paste your error code here, will see whats up there Link to comment Share on other sites More sharing options...
bomby Posted October 3, 2016 Share Posted October 3, 2016 (edited) Hi, does $order->getOrdersTotalPaid() contain shipping cost? If so, how can I remove/exclude the shipping cost? In addition, what is the format of the return value of getOrdersTotalPaid()? Example, for $15.20, does it return "$15.20" or just "15.20" (w/o money sign)? Thanks! Edited October 3, 2016 by bomby (see edit history) Link to comment Share on other sites More sharing options...
YiannisK Posted October 11, 2016 Share Posted October 11, 2016 It's without currency sign. you can use vekia's answer at the first page. so use the: 'total_products'=>$order->total_products,or with tax included: 'total_products'=>$order->total_products_wt, Hi, does $order->getOrdersTotalPaid() contain shipping cost? If so, how can I remove/exclude the shipping cost? In addition, what is the format of the return value of getOrdersTotalPaid()? Example, for $15.20, does it return "$15.20" or just "15.20" (w/o money sign)? Thanks! Link to comment Share on other sites More sharing options...
YiannisK Posted November 1, 2016 Share Posted November 1, 2016 I want to exclude non valid orders from affiliate script (in case there is a problem with payment in credit card payment module) After asking the module creator, he said that the following is executed after the customer returns to the shop: Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart_id.'&id_module='.$modirumeb->id.'&id_order='.$modirumeb->currentOrder.'&key='.$secure_key); and that I have to query the orders table using the cartid, a success transaction updates the record 'valid' to 1. Since I cannot do it in tpl file, how should I modify the OrderConfirmationController.php in order to achieve that? Thanks all! okay, so let's do the show ;-)open the file:controllers/front/OrderConfirmationController.phpyou've got there: $this->setTemplate(_PS_THEME_DIR_.'order-confirmation.tpl'); right before this code, paste this one: $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(), 'description'=>$description )); then in order-confirmation.tpl use:{$total_to_pay} instead the __ADD_SALE_VALUE__{$description} instead the __ADD_DESCRIPTION__save changes and trylet me know if it works exactly as you expectregards Link to comment Share on other sites More sharing options...
Ben90 Posted July 7, 2017 Share Posted July 7, 2017 Hi, I heard that Google Analytics module from Prestashop has covered this issue. Is that correct? I'd like to add eCommerce tracking by adding this actually: <script> dataLayer.push({ 'event':'ecomm_event', 'transactionId': 'XXXXX', // Transaction ID - this is normally generated by your system. 'transactionAffiliation': 'XXXXXXX', // Affiliation or store name 'transactionTotal': 'XX.XX', // Grand Total 'transactionTax': 'XX.XX' , // Tax. 'transactionShipping':'XX.XX', // Shipping cost 'transactionProducts': [ { 'sku': 'XXXXXX', // SKU/code. 'name': 'XXXXXXXX', // Product name. 'category': 'XXXXXXXX', // Category or variation. 'price': 'XX.XX', // Unit price. 'quantity': 'X' }] }); </script> I am not sure whether this one is included in the module. Anybody can help? Thanks. 1 Link to comment Share on other sites More sharing options...
trace Posted August 18, 2017 Share Posted August 18, 2017 (edited) <script> dataLayer.push({ 'event':'ecomm_event', 'transactionId': 'XXXXX', // Transaction ID - this is normally generated by your system. 'transactionAffiliation': 'XXXXXXX', // Affiliation or store name 'transactionTotal': 'XX.XX', // Grand Total 'transactionTax': 'XX.XX' , // Tax. 'transactionShipping':'XX.XX', // Shipping cost 'transactionProducts': [ { 'sku': 'XXXXXX', // SKU/code. 'name': 'XXXXXXXX', // Product name. 'category': 'XXXXXXXX', // Category or variation. 'price': 'XX.XX', // Unit price. 'quantity': 'X' }] }); </script> I also need this!now we have solution for prestashop 1.3Hello, Vekia! Can you help us? Do you have a solution for Prestashop 1.6? Edited August 18, 2017 by trace (see edit history) Link to comment Share on other sites More sharing options...
CWB Posted September 7, 2017 Share Posted September 7, 2017 (edited) Hello, Shareasale requested us that we send price without shipping cost, the code Vekia provided only send price with shipping cost. I tried also many other solutions on this topic without success, I would like the tracking code to send only product price without shipping cost... If someone can help... below are the two files that I have modified : /modules/paypal/views/templates/front/order-confirmation.tpl <img src="https://shareasale.com/sale.cfm?amount={$order.total_products}&tracking={$order.id_order}&transtype=sale&merchantID=74223" width="1" height="1"> /controllers/front/OrderConfirmationController.php $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_products'=>$order->total_products, 'description'=>$description )); Iam using Prestashop 1.6.0.11 with PayPal official module v3.8.1 PS : the below code sucessfully send price (order price + shipping) <img src="https://shareasale.com/sale.cfm?amount={$order.total_paid}&tracking={$order.id_order}&transtype=sale&merchantID=74223" width="1" height="1"> Edited September 7, 2017 by CWB (see edit history) 1 1 Link to comment Share on other sites More sharing options...
Recommended Posts