Jump to content

[solved] problem with external widget


Recommended Posts

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

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

  • Like 1
Link to comment
Share on other sites

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

×
×
  • Create New...