Skip to content

Instantly share code, notes, and snippets.

View bryanblake's full-sized avatar
🏄‍♂️

Bryan Blake bryanblake

🏄‍♂️
View GitHub Profile
@bryanblake
bryanblake / gist:1179754
Created August 30, 2011 00:06 — forked from carolineschnapp/related-products.liquid
Related Products — to add to product.liquid
<!-- Solution brought to you by Caroline Schnapp -->
<!-- See this: http://wiki.shopify.com/Related_Products -->
{% assign number_of_related_products_to_show = 3 %}
{% assign image_size = 'compact' %}
{% assign heading = 'Other fine products' %}
{% capture number_of_related_products_to_fetch %}{{ number_of_related_products_to_show | plus: 1 }}{% endcapture %}
{% if collection == null or collection.handle == 'frontpage' or collection.handle == 'all' %}
<ul class="projects">
<?php foreach($page->children()->visible()->shuffle() as $project): ?>
<?php $image = $project->images()->first() ?>
<li>
<a href="<?php echo $project->url() ?>"><img src="<?php echo $image->url() ?>" /></a>
</li>
<?php endforeach ?>
</ul>