layered navigation hide out of stock items
When people use the layered navigation plugins that are available they dont want to know if you make a product in their size they want to know if you HAVE a product in that size! :) If it could only show items that are still in stock the world would be a better place!
I noticed that the layered nav widget uses the attributes values to function.
This works fine for most products. However, for variable products, shouldn't it use the variations values data instead to show what's available?
In a test I did, I edited a variable product, and removed all variations but 1. I left the attributes as is (most were selected). Instead of showing just 1 size as available, all sizes were displayed as being available, only because the attributes were present in that variable product.
A quick fix would be to remove attributes which aren't available from each product. However, it's not ideal either. When a product goes out of stock, it's still listed as being available by the layered nav widget even though it's not (and it will be until something is done manually).

19 comments
-
Fefe commented
Any solutions yet?
-
Anonymous commented
This isn't supported. Why is it marked as completed?
-
Marie Clarke commented
Solution needed
-
Bill Karkavos commented
Following up - this is not resolved despite the fact that it has been marked as Completed! (?)
quite a few people asking for a solution to this
https://wordpress.org/support/topic/filter-inout-stock-product-variables-still-impossible/
https://wordpress.org/support/topic/hide-out-of-stock-variations-when-filtering/
again the github issue here >
-
Natacha commented
Our personal solution here.
https://gist.github.com/thelonelycats/97ad9afd47bb048ddfbca4952ec91e18
Our code wrap out of stock variations with a div + class, but with small modifications I think you could simply remove out of stock variations.
-
L. M. Lorca commented
Mike Joley said in April 12: "Core supports this. There are also more layered nav improvements coming in 2.6!"
But I don't see that's the case? Layered nav includes product variations out of stock and that's really AWFUL for clothing and shoes specially!
-
John commented
@stimart your website doesn't work
-
Stimart commented
I think I've solved it! Please, look at this link: http://www.stimart.net/web/woocommerce-hide-out-of-stock-items-that-appears-using-layered-nav-filter-widget-solution-3/
-
Bobbi K commented
Some communitiy fixes offered here http://marios.bekatoros.eu/woocommerce-hide-out-of-stock-items-that-appears-using-layered-nav-filter/
In response to my Github issue tracker report located here:
https://github.com/woothemes/woocommerce/issues/5840 -
Stimart commented
-
Stimart commented
My personal solution here: http://www.stimart.net/web/woocommerce-hide-out-of-stock-items-that-appears-using-layered-nav-filter-widget/
-
Anonymous commented
"Hi
I have the same problem, I am getting a fix done on codeable. $330. a contribution and I be happy to share"Do you have a demo site with working patch?
-
Rafa commented
Same solution needed. Please, fix it.
-
Bill Karkavos commented
GitHub issue > https://github.com/woothemes/woocommerce/issues/5840
-
Bill Karkavos commented
@ anonymous > are you happy to share?
-
Bill Karkavos commented
yes a solution on this is much needed
-
Lisa Evans commented
I also need this solution
-
Sylvie Janssens commented
I also have the same problem. Clients of my also said that it's very annoying, so I would be very happy when you could solve this.
If you want to try it, my website is www.kaatenco.be -
Anonymous commented
Hi
I have the same problem, I am getting a fix done on codeable. $330. a contribution and I be happy to share