What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: How can I change availability filter behavior?

How can I change availability filter behavior?

karol_jaskowiak
Visitor
1 0 0

Hi there!

 

I’d like to change the behavior of availability filter.

 

Some of my items are being shown as 'sold out' when they are still available in several capacities.

My products have few capacities, like 5 grams, 10 grams, 20 grams.

 

Let’s say, some products have only 20 grams unavailable but rest are available. After applying ‚out od stock’ filter, that kind of product will be shown as out of stock (but it’s now completely out of stock)
 
How can I change the filter behavior to show products as out of stock, when ALL of the capacities are sold out? 

 

I’m using DAWN theme.

 

There was very similar topic here: https://community.shopify.com/c/shopify-discussions/items-shown-as-sold-out-how-do-i-change-it/m-p/2...

 

I tried to apply instructions that were given there, but I couldn’t find "product-template.liquid" or "product.liquid" files in my sections folder...

 

Thank you in advance!

Replies 2 (2)

Taknify
Shopify Partner
262 18 29

Just reading out your problem, it seem your issue is with products showing out of stock even though one of its variant is still in stock.
This is relatively simple to fix 

{% for variant in product.variants %}
  {% if variant.inventory_quantity > 0 %}
    {{ your logic goes here }}
  {% endif %}
{% endfor %}


Now depending on which theme you are using, this code should be added accordingly. 
If you want, I can help you do just that if I get access to the store along with the collaborator code. 

Hope this helps somehow. 

Need to tweak your store for Black Friday? Simply, send me a message.

tim
Shopify Partner
3911 394 1435

Since you have not provided a link to your store I can only assume the way your store is setup.

 

When filtering by product options Shopify filters work on variant rather than product level.

So if one selects "Capacity:20 grams" then it will show only "Availability: Not available" in filters.

 

And this totally makes sense because indeed you do not have 20gram products in stock.

This is not something you can change without using different filter and sort app ...

 

If my post is helpful, consider liking it -- it will help others with similar problem to find a solution.
I can be reached via e-mail tairli@yahoo.com