Refers to FiboSearch Pro only

How to search for products by custom taxonomy?

The solution requires custom PHP snippets. To apply, you can both:

  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.

The following example is taken from our mockup store, The Bookstore Online. Book authors are custom taxonomies with the name book_author

Step 1 – Register your custom taxonomy in FiboSearch 

add_filter( 'dgwt/wcas/indexer/taxonomies', function ( $taxonomies ) {
	$taxonomies[] = 'book_author';

	return $taxonomies;
} );

Step 2 – Turn on “Search in authors” in the FiboSearch settings 

Go to WooCommerce -> FiboSearch -> Search config (tab). The new checkbox called “Search in authors” should appear under the section “Products search scope”. Check it and save the settings.

Step 3 – Rebuild the search index

After saving the settings, the search index should start rebuilding automatically.

Go to WooCommerceFiboSearchIndexer (tab) and rebuild the search index. Wait for this process to finish.

Step 4 – Let’s see if it works

Check if you can search products by terms from the custom taxonomy.