The WooCommerce Product Search extension helps to control and improve the relevance of search results and adds facilities that supply instant results while visitors search for products.
Installation ↑ Back to top
- Download the .zip file from your WooCommerce account.
- Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
- Install Now and Activate the extension.
More information at: Install and Activate Plugins/Extensions.
Setup and Configuration ↑ Back to top
Note that the standard search fields and widgets are unaffected by this extension. Search facilities that it provides are meant to replace the standard facilities only where desired.
To begin setup:
- Go to: WooCommerce > Settings > Search.
- Tick the Use Weights checkbox. Enabling the use of weights will improve relevance in product search results.
- Enter preferences under Relevance. Enter a number based on how much you wish the search keyword to pull from Title, Excerpt, Content and Tags.
- Save changes.
Weights can also be set for specific products and product categories.
Instant Search ↑ Back to top
Shortcode ↑ Back to top
An instant search facility is deployed by using this shortcode:
and placing it on a page
Widget ↑ Back to top
Instant search is also used via the widget that comes with WooCommerce Product Search.
API ↑ Back to top
Theme developers can also use the plugin’s API to include in a template.
Customization ↑ Back to top
Use Product Search instead of the default search
You need to edit your theme’s searchform.php file, preferably using a child theme to preserve customizations against upgrades. More here: How to set up and use a child theme
From your parent theme’s searchform.php template file, copy it from the parent theme directory to your child theme directory and edit to conditionally output the WooCommerce Product Search (if it exists). The following snippet demonstrates one way that this might be accomplished, in this case placing it at the beginning of the searchform.php file:
If using Storefront or one of the Storefront child themes, there isn’t a searchform.php file.
Questions and Feedback ↑ Back to top
Have a question before you buy? Please fill out this pre-sales form.
Already purchased and need some assistance? Get in touch with a Ninja via the Help Desk.