I want to make a filter by attribute for variable products but the problem is that the filter shows out of stock product, and I have to hide the out of stock products checked, but it didn’t solve the issue, thanks in advance
Question posted in Woocommerce
The official Woocommerce documentation can be found here.
The official Woocommerce documentation can be found here.
2
Answers
I am using WOOF product filter plugin, so i found that i need to put this code in functions.php to only get in stock products filter
This is standard woocommerce functionality, it shows “out of stock” products on the shop page, in the woocommerce widgets, everywhere.
Only on the product single is “Out of stock” shown instead of an “Add to cart”.
Go to
Woocommerce → Settings
and click the Products tabClick the
Inventory link
at the topIf above option is already checked. Please try below code in your functions.php file of current theme.
I hope it will help you.
Thanks