webpeon Posted June 10, 2012 Share Posted June 10, 2012 I am trying to add code for sharethis buttons directly to the header/footer file but for some reason its not liking the scripts at all and seems to break the page. I am adding the javascript directly into the header section just below hook_header. I was expecting this just to work but unfortunately its a no go, am I doing something wrong here, is there a proper way to do this? Link to comment Share on other sites More sharing options...
SuperCharlie Posted June 10, 2012 Share Posted June 10, 2012 I am new so take this for what its worth... I added some custom javascript to my header.tpl in my theme. I added it in the head section of the code and it worked ok. Good luck. Link to comment Share on other sites More sharing options...
webpeon Posted June 11, 2012 Author Share Posted June 11, 2012 Thats actually good news, atleast I know I can add custom jscript directly into the header.tpl, now Im wondering if its not my app but my host provider setup somehow crashing things... Im wondering if its a permission error of some sorts as the script does access an external site Link to comment Share on other sites More sharing options...
cocothecat Posted June 11, 2012 Share Posted June 11, 2012 (edited) The JS could be conflicting with another script. Try placing the script in the footer (so it loads last) and see if that still causes the issue, my bets it will. Have you set the site to work with your root i.e? yourdomain.com and your working with script on yourdomain.com/devfolder that can be a nother cause for it... There is a sharethis module for prestashop Edited June 11, 2012 by cocothecat (see edit history) Link to comment Share on other sites More sharing options...
webpeon Posted June 11, 2012 Author Share Posted June 11, 2012 Thanks coco, you are correct, I loaded the script in the footer section and the results the same, a blank page, just to test your theory even further I placed the code in an html file on my root directory and iframed it into the page and everything worked perfectly, accept for loading an iframe inside an iframe it would be a suitable option Im not quite understanding the directory advice you gave though, the script has been inserted into the header.tpl inside the themes folder (domain.com/themes/nzstore/header.tpl) and the page im loading is the index.php page Yeah Im thinking about using the module option the only downside being is im going to have to create a new hook to get it to show where I want it, not a biggie but Im trying to avoid any core component changes Link to comment Share on other sites More sharing options...
cocothecat Posted June 11, 2012 Share Posted June 11, 2012 Are you trying to load in two versions of jquery? try removing the one and see if that has any change, there is something conflicting with it someplace Link to comment Share on other sites More sharing options...
Recommended Posts