How to hide sold out products by coding

Highlighted
New Member
3 0 0

Hey there,

I want to hide sold out products automatically in my shop. I've done some research found 2 ways i want the coding way to do this.

I found this solution but it didn't work for me 

Go to the product-grid-item.liquid under 'Snippets' in the theme editor.

Add the following code on top of the first <div> tag.

{% if product.available == true %}

and close the if below the last </div> tag. That is at the end of the file.

{% endif %}

 

https://community.shopify.com/c/Shopify-Design/Hide-Out-Of-Stock-Products-from-Collections/td-p/3673...

Any advice?

0 Likes
Shopify Staff
Shopify Staff
324 9 35

Hi, @Shulebags 


Elle here from Shopify. 


I've moved your post from our Technical board over to our Design board where you should receive a better response.


Cheers,
Elle

Elle | Social Care @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

0 Likes