Warning: Use of undefined constant closed - assumed 'closed' (this will throw an Error in a future version of PHP) in
/home/customer/www/codenegar.com/public_html/wp-content/themes/codenegar/functions.php on line
171
|
Hi,
- I would like to filter stock by the number of stock available.
eg. If I have 5 units or 10 units then only items with 5 or more units in stock should show.
2) A radio button on the front end to filter in stock and out of stock items.
|
|
Hi,
As you know WooCommerce saves the number of stock available in the products meta field and its name is _stock.
You can use the plugin Product Filter by Custom Meta to filter stock or other kinds of post custom meta fields.
But you should note that by default products don’t have stock numbers and it activates when you check to Manage Stock checkbox option in the product edit page.
Hiding out of stock items can be done using different methods such as setting minimum number of the above filter to 1 or open WooCommerce settings > Products > Hide out of stock items from the catalog

Thanks.
|
Write a reply