Jump to content

[solved] how to install external widget


Recommended Posts

Hi I wanted to add this code from we heart onto to my page

 

<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>

 

I wanted to add it under the tumbler button seen here : http://uniqjewelryde...-necklace-.html

 

I have tried product tpl, all different blocks and apparently i'm not doing it right lol. Can someone please help :) and Thanks in advance !!

Link to comment
Share on other sites

use {literal}{/literal} tags for java scripts:

{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}

  • Like 1
Link to comment
Share on other sites

Ok I have one more problem. On the 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}

Edited by Uniq (see edit history)
Link to comment
Share on other sites

×
×
  • Create New...