dotcompixel.com Posted April 28, 2014 Share Posted April 28, 2014 Hello everybody, I have this problem with Prestashop 1.6. I need to add jquery tracking code into footer of default temlate. This tracking code is from Post Affiliate Pro. My problem is that Prestashop cut my jquery code and I do not know why. As you can see on screen first is from Prestashop and second is from website where code is ok. I am adding this jquery code into footer.tpl of default template. Can you someone help me how to solve this problem? First image: Second image: Link to comment Share on other sites More sharing options...
dioniz Posted April 28, 2014 Share Posted April 28, 2014 I am putting all my extra scripts in a new file named scripts.js and i put it in mytheme/js folder. Then i add line of code to header.tpl just before </head> tag like this: <script src="{$js_dir}myscript.js"></script> Maybe this will work for you. Link to comment Share on other sites More sharing options...
vekia Posted April 28, 2014 Share Posted April 28, 2014 btw. can you show how your js code looks like? (original code) Link to comment Share on other sites More sharing options...
dotcompixel.com Posted April 28, 2014 Author Share Posted April 28, 2014 (edited) There is tracking code. <script type="text/javascript"><!-- document.write(unescape("%3Cscript id='pap_x2s6df8d' src='" + (("https:" == document.location.protocol) ? "https://" : "http://") + "postaffiliatepro.com/scripts/trackjs.js' type='text/javascript'%3E%3C/script%3E"));//--> </script> <script type="text/javascript"><!-- PostAffTracker.setAccountId('default1'); try { PostAffTracker.track(); } catch (err) { } //--> </script> Edited April 28, 2014 by quiced (see edit history) Link to comment Share on other sites More sharing options...
dotcompixel.com Posted April 28, 2014 Author Share Posted April 28, 2014 I tried to add tracking code into extra file but the problem is that code have to be in header not in file. Link to comment Share on other sites More sharing options...
dioniz Posted April 28, 2014 Share Posted April 28, 2014 Then try to put it in header.tpl just before </head> tag Link to comment Share on other sites More sharing options...
dotcompixel.com Posted April 29, 2014 Author Share Posted April 29, 2014 (edited) I've tried to put my tracking code into header.tpl then use {literal} tag but nothing help me. As you can see in new screen, prestashop still deform my jquery code. Could you someone help me to solve it? Thank you for help. Edited April 29, 2014 by quiced (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts