fairdesign Posted April 24, 2016 Share Posted April 24, 2016 (edited) Hi there, I'm trying to integrate a tracking code of an affiliate network. We need to insert a javascript code in confirmation page of each payment platform. We have to provide 3 values to this code, we've got two of them by doing this: (prestashop v1.6.1.4) Edit .tpl file of order confirmation page of each payment module and insert the affiliate tracking code. Insert order reference and price value to this script: var OrderReference = "{$reference_order}"; var OrderValue = "{$ordersTotalPaid}"; In order to have both reference_order and ordersTotalPaid available in .tpl file we need to assign previously in orderConfirmationController.php by injecting on smarty. $this->context->smarty->assign(array( 'ordersTotalPaid' => $order->getOrdersTotalPaid(), 'reference_order' => $this->reference )); This code is inserted on displayPaymentReturn() function. Now we have to provide also the voucher (discount code) used by the client so the question is how can we get this value? I hope I'm not wrong section. Thanks in advance. Edited April 24, 2016 by fairdesign (see edit history) Link to comment Share on other sites More sharing options...
shokinro Posted April 25, 2016 Share Posted April 25, 2016 you will need to read discount information from database and then assign to Smarty variables. the table you need to read is ps_order_cart_rule The about table, you can get the ID/Name/Value of voucher. but if you need the code, you will need to read(join) wih this table too. ps_cart_rule 1 Link to comment Share on other sites More sharing options...
fairdesign Posted July 8, 2016 Author Share Posted July 8, 2016 Thanks Shokinro and I apologize for answering so late... Your solution was successful. Regards. Link to comment Share on other sites More sharing options...
shokinro Posted July 8, 2016 Share Posted July 8, 2016 I am glad it worked for you. thanks for your feedback Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now