Hide out of stock products from default vendors collections

David_Georges
New Member
8 0 0

Hello,

I would like to hide out of stock products from vendors collections that are automatically created by Shopify.

Here is my vendors list page : https://shop.happylist.me/pages/nos-marques

If you click on a brand you will see a lot of out of stock products... I would like to avoid that.

Can you help?

 

0 Likes
Pippa_Ridley_-_
Shopify Expert
220 0 11

Hi David

Does this article help: 

https://help.shopify.com/manual/products/inventory/hide-out-of-stock

Pippa

If you need help with a Shopify customisation, drop me an email on pipparose@etempa.co.uk
0 Likes
David_Georges
New Member
8 0 0

Hi Pippa,

No, as brand collections are automatically created by default by Shopify... don't know where to add the stock condition or override this behavior :(

Regards,

David.

0 Likes
Pippa_Ridley_-_
Shopify Expert
220 0 11

I know you've got a lot of brands, but I think if you create a collection for each brand and make sure the url is /collections/brand-name (exactly what the vendor name is) it should override? 

If you need help with a Shopify customisation, drop me an email on pipparose@etempa.co.uk
0 Likes
David_Georges
New Member
8 0 0

Hello Pippa, thank you for your anwser ?

I have 900+ brands... and 30.000+ products that are automatically synced with my supplier (dropshipping). So new brands are created every day... So your solution is not imaginable ?

Regards,

David.

0 Likes
Pippa_Ridley_-_
Shopify Expert
220 0 11

Haha fair enough! That's quite a lot. 

Could this app help you at all? https://apps.shopify.com/power-tools-auto-collections

If you need help with a Shopify customisation, drop me an email on pipparose@etempa.co.uk
0 Likes
Lixon_Louis
Shopify Partner
1181 35 238

David, open your collection-template.liquid and add the following condition as in this screenshot > http://take.ms/bS2Sh .

If you are using the (updated) Simple theme you should find this file inside Sections. Let me know

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

 

Get help at lixon@ecommercestudio.in
0 Likes
David_Georges
New Member
8 0 0

Hi Lixon, your solution works but the pagination is no longer correct as you hide products without removing it from the product list... The result is that you get pages with 1-2 products :(

0 Likes
jcode
New Member
1 0 0

You can achieve it by changing the code in the collection.template.liquid file as follows

 

{%- if collection.products.size > 0 -%}
            {%- for product in collection.products -%}
            {% if product.available %} 
            <div class="col-6">
              {%- include "product-grid-item" -%}
            </div>
            {%- endif -%}
            {%- endfor -%}
 {%- endif -%}

 

 

0 Likes