Include “out of stock” products in search results

When “Out of stock visibility” is enabled in WooCommerce Settings, the FiboSearch “Out of stock visibility” option automatically inherits the setting. However, if you need to hide products in the catalog but want to show them in the search results, you can override the setting with the following snippet:

//Force value of "Exclude “out of stock” products" option as "off"
add_filter( 'dgwt/wcas/settings/load_value/key=exclude_out_of_stock', function ( $value ) {
    return 'off';
}, PHP_INT_MAX - 5 );

You have two ways to add this code to your theme:

  1. Open the functions.php file in your child theme and add the code at the end
  2. Or install the Code Snippets plugin and apply this code as a snippet.