Edit Collection

dreamworldeques
Tourist
9 0 4

Hello

I created manual collection long time ago.
Now I realize that I need to hide out of stock product and for that Automated collection have condition which helps to hide product.

how to do that in manual collection ??

thank you

KetanKumar
Shopify Partner
23400 2356 8622

@dreamworldeques 

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community!
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
dreamworldeques
Tourist
9 0 4

Thank you Ketan

here you go

www.saddleonlineshop.com

0 Likes
Ninthony
Shopify Partner
2240 337 895

So a way to do this is to go into your collection-template.liquid file and look where your product is being output. Generally you'll see something like:

{% for product in collection.products %}
//product info
{% endfor %}

 

You could wrap the product info in a condition.

 

{% for product in collection.products %}
  {% if product.available %}
    //product info
  {% endif %}
{% endfor %}

 

This would essentially hide out of stock products on your store. There is a problem with pagination this way however. Let's assume someone is browsing a selection of your products that has two pages of results with 10 products on each page. On the first page, 2 of those 10 products are out of stock. It would only show 8 products, and you'd have to go to the next page to see more, it still counts those that arent being displayed as results for the pagination to show 10.

 

There is an app that can help out called Out of Stock Police I have heard of people using.

 

If my solution helped you, please like it and accept it as the solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
dreamworldeques
Tourist
9 0 4

Thank you @Ninthony 

Your quick idea is great . Please let me know if you have solution for pagination .

App always creates 404 not found which I personally dont like at all.

0 Likes