juxtro Posted August 13, 2012 Share Posted August 13, 2012 Hello, I have to integrate this tracking code from a cashback site. It has 2 parts. First is this: "Paste this code immediately BEFORE the closing </head> tag on every page of your website: <script type="text/javascript" charset="utf-8"> (function() { var cc = document.createElement('script'); cc.type = 'text/javascript'; cc.async = true; cc.src = 'https://tracking.www.cashcow.ro/c5ab0bc60ac7929182aadd08703f1ec6.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cc, s); })(); </script>" The second part is this: "Paste this code immediately BEFORE the closing </head> tag on your order confirmation page and follow the instructions below to customize it: <script type="text/javascript" charset="utf-8"> var ccg = "{COMMISSION_GROUP}"; var cct = "{TRANSACTION_TOTAL}"; var vcc = "{VOUCHER_CODE}"; var ccd = "{OPTIONAL_DETAILS}"; (function() { var cc = document.createElement('script'); cc.type = 'text/javascript'; cc.async = true; cc.src = 'https://tracking.www.cashcow.ro/c5ab0bc60ac7929182aadd08703f1ec6.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(cc, s); })(); </script>" The instructions for costumization are: "{COMMISSION_GROUP} The commission group is a predetermined string used by the system to determine the commission amount: the amount you will owe from the transaction total. Here is the list of predetermined commission groups you can use: Commission Group Commission xxx xxx {TRANSACTION_TOTAL} This one's pretty straight forward: it should be a floating point number (comma as the decimal separator) representing the total value of the transaction. The system will use this to calculate the commission you will owe. {VOUCHER_CODE} If the client used a valid voucher in the order, put the exact voucher code used in here. {OPTIONAL_DETAILS} This is for your reference only. The string you enter here is displayed in your transactions panel" I've added the first code to the footer.tpl and the second in the order_confirmation.tpl but it's not working so I probably did it wrong. Please help me. Thank you Link to comment Share on other sites More sharing options...
tomerg3 Posted August 13, 2012 Share Posted August 13, 2012 Did you clear the smarty cache? Do you see the code when you "View Source"? Link to comment Share on other sites More sharing options...
juxtro Posted August 16, 2012 Author Share Posted August 16, 2012 Yes, I did clear the smarty cache and i see the code in page source but i probably put it in the wrong place. Please, if you have time, tell me with what code i should replace the variables "transaction_total", "voucher_code" and "optional_details" and where should i put this code? In the first mail i've written also the instructions to replace those variables as i reveiced the from the cashback site. Thank you. Link to comment Share on other sites More sharing options...
tomerg3 Posted August 16, 2012 Share Posted August 16, 2012 Probably the best place to add the order tracking code is in order-confirmation.tpl As for those variables, once you identify what values they should have, you would need to alter / override OrderConfirmationController.php (displayContent()) and pass those variables to the tpl file. Link to comment Share on other sites More sharing options...
Recommended Posts