Simple newbie issues with using liquid to output products from a collection.

Solved
vscoder
New Member
2 0 0

I am assuming that if products exist they automatically belong the 'featured-collection' collection as I have read.

I am attempting to list out all the collection handles and I get two: 'featured-collection' and 'homepage'

I used this code to get them:

{% for collection in collections %}
{{ collection.handle }}
{% endfor %}

It works as expected. When I run the following code:

{% for product in collection.frontpage.products %}
This is: {{ product.title }}
{% endfor %}

I get nothing back. I have verified in the store that the collection has one product. I have also tried this with 'featured-collection' which should contain six products I created.

I am at a bit of a loss here as this should be simple but I can't get past this.

 

0 Likes

This is an accepted solution.

Think you're just missing the "s". Should probably be collections.frontpage.products

 

Just helping folks learn Shopify theme development - universitheme.com
0 Likes
vscoder
New Member
2 0 0

TY!

0 Likes