How to display ALL individual products in a shopify store

Shopify Partner
33 0 1

I've seen many articles that show how to display all products via admin on home page of certain themes but I am trying to find the liquid code that displays ALL individual products ( NOT collections ) at my disposal.

Here is the code that displays all of my collections, how would I change it to display all of myproducts.

<div class="collection-list grid-uniform small-gutter">

    {% for collection in collections %}

      {% if collection.handle == 'frontpage' %}
        {% continue %}
      {% endif %}

      {% if collection.image %}
        {% capture collection_image %} {{ collection | img_url: 'large' }} {% endcapture %}
        {% capture collection_image_x2 %} {{ collection | img_url: 'grande' }} {% endcapture %}
        {% capture collection_alt %} {{ collection.image.alt }} {% endcapture %}
      {% else %}
        {% if collection.products.size == 0 %}
          {% capture collection_image %}{{ 'no-image.svg' | asset_url }}{% endcapture %}
        {% else %}
          {% capture collection_image %} {{ collection.products.first | img_url: 'large' }} {% endcapture %}
          {% capture collection_image_x2 %} {{ collection.products.first | img_url: 'grande' }} {% endcapture %}
        {% endif %}
        {% capture collection_alt %} {{ collection.title.escape }} {% endcapture %}
      {% endif %}

      <div class="product grid__item one-third medium--one-half small--one-whole text-center">

        <a href="{{ collection.url }}" class="grid__image">
          <img class="retina-img" src="{{ collection_image }}" data-retina-src="{{ collection_image_x2 }}" alt="{{ collection_alt }}">
        </a>

        <p class="h3"><a href="{{ collection.url }}">{{ collection.title }}</a></p>

      </div>

    {% endfor %}

  </div
0 Likes
Shopify Partner
385 0 49

Hello Michael,

To get all the products you need to loop thro the collection called "all" which is automatic. Remember it still obeys the restrictions of pagination.

To loop the collection and get the products you can do something like:

{% for product in collections.all.products %}
    {{ product.id }}
{% endfor %}

Hopefully this was helpful to push you to the right direction.

Kasimir

"Good design is good business"
2 Likes
Shopify Partner
33 0 1

That worked great! Thanks!

0 Likes
New Member
2 0 0


Hi,

 

I have a similar question on how to show all products in a page. I've created a page on my shop that shows featured collections and other topics, and would like to also show all my products (with CAT) below the page for easier purchase but not sure how to code this in my current page. I've managed to add an 'Shop All' button instead but really would just like to show products instead of leading customers to another page.

 

Here's the current shop page now and below it is what I wish to achieve with the product listing:

 

I. Current Page:

 

Current Page with Shop All Button.png

 

II. Page trying to build:

 

Brand Page with CAT draft.jpg

 

Really appreciate the help on this!

0 Likes
New Member
2 0 0

I can't seem to share my code as it's more than the 20,000 word limit. hehe. 

0 Likes