- Getting started
WooCommerce is one the largest free eCommerce plugins available for WordPress, with the number of users growing month by month. The plugin allows an integration of an eCommerce solution on almost any WordPress install, effortlessly.
Relevanssi is a great search plugin that really enhances the basic integral search of WordPress. This is a highly recommended plugin from a number of developers and is also Debunc’s preferred choice of plugin.
- A match made in heaven (sort of)
Now, both plugins are exceptionally easy to integrate with the majority of WordPress installs. Simply adding the plugins, activating them and then following a couple of on screen instructions will get most users where they need to be.
Sometimes, it’s just not that simple.
A number of developers out there (including myself) sit scratching their heads on why these plugins will just not work together. You run a simple search for one your WooCommerce products on the front end, and get ‘0′ results found. Checking the obvious settings in both plugins yields no logical reasons why they aren’t playing well together.
Not to worry. A solution is at hand.
- 1. Set up your search form
The very first thing to action is to create a simple search form. Now you will notice a slight difference between the generic search form and this suggested one you’ll find in most comments on forums.
Of course you can extend the below snippet and customise as much as you wish!
- 2. Configure Relevanssi
Now this is the stage that either makes or breaks things.
You need to ensure that the configuration has been set up correctly for this to work. I have included the recommended options below:
Indexing Options -> Check ‘Product’
Minimum Word Length To Index -> 3
Expand Shortcodes In Post Content -> No (do not check)
- That's it! Relevanssi and WooCommerce working together
I told you it was simple! It seems that primarily the shortcode expansion doesn’t play well with the WooCommerce setup.
I hope you’ve found this short tip useful in your project – and saved you some time searching the sea of answers to this common problem. And if you haven’t already, I’d strongly recommend checking out the two plugins as great WordPress options for a search tool and product manager respectively.