I want to hide Products out of stock

I want to hide Products out of stock

pedromonteirouk
Excursionist
20 1 2

Hi community,

I would like to hide the products that are out of stock.

I want a script to use in a liquid file. I don’t want to use any paid app

Replies 2 (2)

SBD_
Shopify Staff
1829 271 415

Hey @pedromonteirouk 

 

Here are some options: https://help.shopify.com/en/manual/products/inventory/getting-started-with-inventory/hide-out-of-sto...

 

Otherwise to specifically use liquid, try something like this on collection pages:

{% for product in collections.all.products %}
  {% if product.available %}
    <!-- Product card here -->
  {% endif %}
{% endfor %}

 

Scott | Developer Advocate @ Shopify 

pedromonteirouk
Excursionist
20 1 2
Can you tell me in what collection page should I add this code?