FiboSearch in the pro version supports search in product variations. This means that when entering a search phrase into the search bar, matching product variations will appear in the autocomplete results.
However, this functionality isn’t natively supported by WooCommerce. This means that even if matching product variations appear in the autocomplete results, after submitting the form and going to the search results page, WooCommerce will only display the main products, and the variants will be unavailable.
The next sections outline how the search functionality for product variations operates with various plugins that provide this feature, as well as how it may function without such plugins.
Table of Contents
- Plain WooCommerce, without plugins that support searching for product variations
- Integration with WooCommerce Show Single Variations by Iconic
- Plugins we will integrate with in the future
Plain WooCommerce, without plugins that support searching for product variations
If you’re not using any plugins that allow displaying product variations as single products, searching in variations still can work. You can display product variations in an autocomplete dropdown only if a user types an exact match of the variation SKU. To activate it, you need to use the following PHP snippets.
add_filter( 'dgwt/wcas/variation_support_modes', function() { return ['search_in_sku', 'exact_match']; } );Note:
- If you installed FiboSearch before October 28, 2024, this functionality will be enabled by default.
- Ensure that ‘Search in SKU‘ is enabled in
WooCommerce → FiboSearch → Search config (tab)
.
After applying this code, go to WooCommerce -> FiboSearch -> Indexer
and rebuild the search index. After entering the exact SKU match, two records will appear in the autocomplete results. The first one is the variation, and the second is the parent product.
Some users prefer not to display the parent product after a variant. You can hide the parent product with the following CSS:
.dgwt-wcas-suggestion-product-var + .dgwt-wcas-suggestion-product { display: none !important; }
Note:
However, keep in mind that product variations displayed in autocomplete will not appear on the search results page. Integration with one of the plugins below is required for this.
Integration with WooCommerce Show Single Variations by Iconic
FiboSearch integrates with this plugin, allowing single variations to appear directly in autocomplete and on the search results page. Variations will be mixed with other products in the search results.
Search Scope:
- Name of the variation
- Variation attributes (if included in the variation name)
- SKU of the variation
The “WooCommerce Show Single Variations” plugin adds new settings for variations, such as “Show in Catalog?“, “Show in Search Results?“, and others. FiboSearch respects the visibility of variations managed through these new options.
Plugins we will integrate with in the future
- WooCommerce Single Variations by WeLaunch
- Products By Attributes & Variations for WooCommerce by Addify