nicograph77 Posted January 17, 2018 Share Posted January 17, 2018 (edited) Hi, I'm trying to add a Pinterest "Pin it" button when user hover images on the website, by adding the code provided on the Pinterest website here https://developers.pinterest.com/tools/widget-builder/?type=pinit&buttonType=imageHover&language=default&tall=false Basically it's just this simple line of code <script async defer data-pin-hover="true" src="//assets.pinterest.com/js/pinit.js"></script> I've inserted the required script in the footer.tpl file just above the closing </body> tag but apparently there is some conflict with the theme I'm using or with the Prestashop code. I spotted that, once published, the script moves from the place it was inserted and and appears like that in the page source : <script type="text/javascript" src="http://assets.pinterest.com/js/pinit.js"></script> I made a test in a static html file and the Pinterset code is working. Any idea of what's happening ? Thank you in advance. Nicolas. Edited January 18, 2018 by nicograph77 Marked as solved (see edit history) Link to comment Share on other sites More sharing options...
Vince Posted January 18, 2018 Share Posted January 18, 2018 It should be a problem with your theme. You need to check if there is any error in console log. Link to comment Share on other sites More sharing options...
nicograph77 Posted January 18, 2018 Author Share Posted January 18, 2018 Hi Vince, I don't see any error in the console. After some new test I can confirm that it's the removal of the 'data-pin-hover' attribute in the code which cause the script not working. Link to comment Share on other sites More sharing options...
nicograph77 Posted January 18, 2018 Author Share Posted January 18, 2018 I found the solution, in this Stack Overflow threads. Attributes are removed by this' CCC Move JavaScript to the end' performance feature of Prestashop, if you disable it the script is working. 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