juxtro Posted June 14, 2013 Share Posted June 14, 2013 (edited) Hello, I'm trying to implement a tracking pixel from an affiliate marketing network in my shop which runs Prestashop 1.5. They've asked me to insert the following code on order-confirmation.tpl page: <img src="http://www.affiliatenetwork.com/tracking/3/237/ANY_UNIQUE_COMBINATION_THAT_IDENTIFIES_AN_ORDER/ORDER_AMOUNT/CART_SUMMARY" width="1" height="1"> When i used PS 1.4 i've replaced "any unique combination that identifies an order" with {$id_order} and "order amount" with {$orderTotal} and it worked fine so I've inserted the code in the seme form: <img src="http://www.affiliatenetwork.com/tracking/3/237/{$id_order}/{$orderTotal}/" width="1" height="1"> After a test order was made, they've told me that the code isn't installed correctly and they can't see the order total in their system, probably because on order-confirmation.tpl page isn't shown the amount of the order so they asked me to insert the following code to /override/controllers/OrderConfirmationController.php: <?php class OrderConfirmationController extends OrderConfirmationControllerCore { public function displayContent() { global $cart; self::$smarty->assign('orderTotal', ($cart->getOrderTotal() / 1.24) - $cart->getOrderShippingCost()); parent::displayContent(); } } This code is made for PS 1.4 and i don't know to much about programming so please tell me how should the tracking pixel look like and what code should i insert, and where, on orderconfirmationcontroler.php to make it work. Thank you Edited June 14, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted June 14, 2013 Share Posted June 14, 2013 im convinced that this thread: http://www.prestashop.com/forums/topic/250595-solved-affiliate-tracking-code/page__hl__tracking will help you in this case Link to comment Share on other sites More sharing options...
juxtro Posted June 14, 2013 Author Share Posted June 14, 2013 That's what i've looked for. I apologise for not searching before posting. Thank you vekia. You can close this topic. Link to comment Share on other sites More sharing options...
vekia Posted June 14, 2013 Share Posted June 14, 2013 thanks for information, if you've got any questions related to your tracking pixel - feel free to continue discussion im going to mark this thread as [solved] regards Link to comment Share on other sites More sharing options...
juxtro Posted June 14, 2013 Author Share Posted June 14, 2013 I've put this code on orderconfirmationcontroller.tpl: $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 )); and inserted this tracking code on order-confirmation.tpl <iframe frameborder="0" width="1" height="1" src="http://www.affiliatenetwork.com/tracking/2/237/{Tools::getvalue('id_order')}/{$total_to_pay}/{$description}"></iframe> They've tested it and said the lead is being registered but no commision is generated because on the page source isn't any price representing the total amount of the order. Can you please verify if i've made the correct settings? Link to comment Share on other sites More sharing options...
vekia Posted June 14, 2013 Share Posted June 14, 2013 you're talking about {$total_to_pay} variable? you want to use: - total products value without tax ? - total products value with tax ? - total products value without tax + delivery ? - total products value with tax + delivery ? Link to comment Share on other sites More sharing options...
juxtro Posted June 14, 2013 Author Share Posted June 14, 2013 I want to use total products with tax but without delivery Link to comment Share on other sites More sharing options...
vekia Posted June 14, 2013 Share Posted June 14, 2013 so, use {$total_products} variable instead the {$total_to_pay} Link to comment Share on other sites More sharing options...
juxtro Posted June 14, 2013 Author Share Posted June 14, 2013 (edited) thank you for your prompt answer. I've asked them to retest it and i'll post here the result as soon as i'll have it. Edited June 14, 2013 by juxtro (see edit history) Link to comment Share on other sites More sharing options...
juxtro Posted June 17, 2013 Author Share Posted June 17, 2013 Hello, The tracking code is installed correctly now but they asked to show price without tax. what should i write instead of {$total_products}? Also, should i change the code implemented on orderconfirmationcontroller.tpl? Right now it's 'total_products'=>$order->total_products_wt, Thanks Link to comment Share on other sites More sharing options...
vekia Posted June 17, 2013 Share Posted June 17, 2013 so if you have to use product total value but without tax - use {$total_products} variable it's defined in the php code: $this->context->smarty->assign(array( 'total_products'=>$order->total_products, 'description'=>$description )); Link to comment Share on other sites More sharing options...
juxtro Posted June 17, 2013 Author Share Posted June 17, 2013 I've looked on the other topic which you recomended and saw this so use the:'total_products'=>$order->total_products, or with tax included: 'total_products'=>$order->total_products_wt, If i want the tracking pixel to register prices without tax i should use the first variable? Link to comment Share on other sites More sharing options...
vekia Posted June 17, 2013 Share Posted June 17, 2013 omg that's right it was my mistake, yes definitely, use first variable! i corrected my post above. Link to comment Share on other sites More sharing options...
juxtro Posted June 17, 2013 Author Share Posted June 17, 2013 Thank you vekia! Link to comment Share on other sites More sharing options...
lujziana Posted November 3, 2014 Share Posted November 3, 2014 Hello everybody! I have the same problem, I am using prestashop 1.6, can you help me please? I have no idea where to put the conversion pixel tracking code from facebook, I want to track my ads. Can you write me the path in prestashop? I know there is a modul to buy for that but I also gained the information you can put it manualy, I am believing it is not that hard. I appreciate your help! I am just a beginner. Thanx a lot! Link to comment Share on other sites More sharing options...
Nikko Posted December 9, 2014 Share Posted December 9, 2014 +1 Facebook Conversion Code for Page Views Pixel. Where are you suppose to paste this code? At the bottom of themes/default-bootstrap/guest-tracking.tpl maybe? Thanks in advance! Link to comment Share on other sites More sharing options...
Recommended Posts