Remove the sold out items on Product Pages of Brooklyn Theme

Hi, I want it to automatically remove the SOLD OUT items out of my products page. Please help me to fix this. Thank you. I’m using the Brooklyn Theme

Hi @VanTran

Please open your Online Store > Themes > Edit code, open collection-template.liquid file, find 2 lines of this code below

{%- include 'product-grid-collage' -%}

And

{%- include 'product-grid-item' -%}

Change them to this

{% if product.available %}
    {%- include 'product-grid-collage' -%}
{% endif %}

And this

{% if product.available %}
    {%- include 'product-grid-item' -%}
{% endif %}

Save your file

Hi @VanTran

I have tried searching on the theme you mentioned but I do not see any.

Could you please share with us the name of the theme again and share your store URL to check further?

Look forward to your response.

Best,

Daisy

What’s your goal – remove sold out products from your online store completely or remove them from particular collection?

If you want to remove them from collection, then common practice is to add “Inventory level > 0” condition to your automatic collection(s).

This way your products will still be visible on your store if, for example visitors search for them or have direct link to product page.

But not on collection pages.

If you want to completely take down sold out products, then you should install the free Flow app and use the this template:

Hide out of stock products from your online store and republish when they have at least a variant with inventory:> https://shopify.com/admin/apps/flow/editor/templates/f1e2ce62-841e-4a9c-801d-87bac65d04cc

Editing the code like suggested above is not the best option if you have more than one page of products in your collection.

1 Like

Hi Daisy, I see my theme isn’t available on Theme Shop anymore, this is my store URL: https://hannahcanvas.com/. Thank you for checking

Hi, you already help me solve my problem. I set up the inventory stock condition to be greater than 0 and it worksss. Thank you so much

1 Like