Hide sold out or out of stock products from collection pages

How to hide sold out or out of stock products is easy, if you know HTML and CSS, and have a basic understanding of Liquid. And doesn’t require any app. Just copy and paste a bit of code and you’re all set! If you don,t know coding then you can follow the shopify official instruction here.

It may be something like this on the collection-template.liquid in the theme file:

{% for product in collection.products %}
{% include 'product-grid-item' %}
{% endfor %}

 

change it to:

{% for product in collection.products %}
{% if product.available %}
{% include 'product-grid-item' %}
{% endif %}
{% endfor %}

 

And that’s it!
If you have any trouble, feel free to leave a comment below and I’ll do my best to help.

1 comment

  • Show only active products, when I clicks to out of stock then only (sold out )products have been shown

    Anusha

Leave a comment

Please note, comments must be approved before they are published