Show products within collection
First used on the Michael Jackson single product site.
Displays the products within the collection with variant dropdown & cart button.
- Open index.liquid and comment out the featured collection code.
- Add the following code below the commented section
- Change "home" to the name of the collection that needs looped
- Change the limit from 1 to the number of products to show.
<div class="row mj-homepage-collection">
{% for product in collections.home.products limit: 1 %}
<img src="{{ product.featured_image.src | product_img_url: 'large' }}">
<h4>{{ product.title }}</h4>
<div class="product-price">
<span class="money" itemprop="price">{{ product.price | money }}</span>
</div>
{% if has_cart %}{% include 'product-add-to-cart-form' %}{% endif %}
{% endfor %}
</div>