Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Mikko Saari

    (@msaari)

    Are you using WooCommerce? If you are, add this to your theme functions.php:

    add_filter( 'relevanssi_woocommerce_indexing', function( $blocks ) {
      $blocks['outofstock'] = true;
      return $blocks;
    } );

    This will make Relevanssi exclude out-of-stock products from the index.

    Thread Starter univ182

    (@univ182)

    Hello, thanks for reply,

    Indeed, when I build the index again, fewer products appear, but.

    This may depend on the theme, I’m using woodmart and the ajax search still shows out-of-stock products, example: PGF95K

    https://usaelectrodomesticos.com.co/

    If I search for this sku, the product appears.

    Should I do some more?

    Thanks for reply

    Plugin Author Mikko Saari

    (@msaari)

    That Ajax search is not using Relevanssi. It’s the Woodmart Ajax Search. Apparently Woodmart has a setting “Use Relevanssi for AJAX search” – is that setting enabled?

    Thread Starter univ182

    (@univ182)

    Yes that’s how it is.

    both the search by sku and by name have this problem in that search ajax header

    Plugin Author Mikko Saari

    (@msaari)

    Well, it does look like it’s not using Relevanssi, even though the setting would claim it is. I recommend you ask Woodmart support about this.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How can I exclude the sold out product in the search’ is closed to new replies.