Created
July 1, 2009 12:12
-
-
Save carlwoodward/138746 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul id="recommendations"></ul> | |
<script type="text/javascript"> | |
function display_recommendations(recommendations) { | |
$A(recommendations).each(function(recommendation) { | |
var li = new Element('li'); | |
var a = new Element('a', {'href': '/products/' + recommendation.handle}).update(recommendation.title); | |
var img = new Element('img', {'src': Shopify.resizeImage(recommendation.images.first().src, 'small')}); | |
var image_link = new Element('a', {'href': '/products/' + recommendation.handle}).update(img); | |
li.insert(new Element('h4').update(a)); | |
li.insert(image_link); | |
$('recommendations').insert(li); | |
}); | |
} | |
</script> | |
<script type="text/javascript" src="http://werecommendapp.com/recommendations/product/{{ product.id }}.json?shop=*your_shop_name*.myshopify.com&callback=display_recommendations"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment