Knowledge Base

WooCommerce: Making a product in-stock & out of stock filter

in Ajax Search Pro Tips Tags: ajax search procustom fieldfilterout of stockstock status

Product stock status in WooCommerce is stored in the _stock_status private custom field, which can have two values: instock and outofstock

On the search instance Frontend Search Settings -> Custom field filters panel you can easily make a filter on this field:

..this will result in:

Detailed Instructions

  • To the Custom Field input enter: _stock_status
  • In this example I use the Radio type, but Checkboxes or Drop-down is just as good
  • To the values textarea enter:
    ||Any value**
    instock||In stock
    outofstock||Out of stock

For more information about custom field filters please visit the following documentation chapter: Ajax Search Pro for WordPress – Custom field filters