Uniq Posted July 20, 2013 Share Posted July 20, 2013 Hi, On the we heart it widget it asks for image url, Is there anyway i can hook it into the code so that it will automatically add the image url? because adding them individually gives me duplicate buttons on each product :/ Thanks {literal}<a href="//weheartit.com/heart-it" class="heart-it-button" data-type="vertical" data-image-url="" data-source-url="www.uniqjewelrydesigns.com">Heart It</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//assets.whicdn.com/assets/heart_it_button.js";fjs.parentNode.insertBefore(js,fjs);}else if(whi){whi.HeartItWidget();[spam-filter](document,"script","whi-heartitbutton");</script>{/literal} Link to comment Share on other sites More sharing options...
Mellow Posted July 21, 2013 Share Posted July 21, 2013 Hi, Assuming that you are going to put this code on product page (product.tpl), and you want to link the widget to the full size product cover image, your code should be : <a href="//weheartit.com/heart-it" class="heart-it-button" data-type="vertical" data-image-url="{$link->getImageLink($product->link_rewrite, $cover.id_image)}" data-source-url="www.uniqjewelrydesigns.com">Heart It</a> {literal}<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//assets.whicdn.com/assets/heart_it_button.js";fjs.parentNode.insertBefore(js,fjs);}else if(whi){whi.HeartItWidget();[spam-filter](document,"script","whi-heartitbutton");</script>{/literal} Note that I moved the {literal} tag because it is needed only for the script, and the link has to be outside Regards 1 Link to comment Share on other sites More sharing options...
Uniq Posted July 21, 2013 Author Share Posted July 21, 2013 Hi ok so I changed it to the code you posted and now the image shows however I get this error now There was an error saving the image: Failed to retrieve the source page title. Link to comment Share on other sites More sharing options...
Uniq Posted July 21, 2013 Author Share Posted July 21, 2013 (edited) Oh I got it, had to change the www. to http:// Ok Thank you so much for your help !!!!!!!!! Edited July 21, 2013 by Uniq (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted July 21, 2013 Share Posted July 21, 2013 hello i marked this thread as [solved] best regards Link to comment Share on other sites More sharing options...
Recommended Posts