1. Documentation /
  2. Product Finder

Product Finder

Product Finder helps boost your WooCommerce site search capability with a detailed advanced search, which allows customers to find products more easily.

Product Finder allows users to search for items using any combination of product categories or attributes. Plus, it includes a text search and price slider.

The Product Finder form as it appears in the Twenty Twelve theme
The Product Finder form as it appears in the Twenty-Twelve theme

Requirements

↑ Back to top
  • WooCommerce 3.5+
  • PHP 5.4+

Installation

↑ Back to top
  1. Purchase and download the plugin zip file from WooCommerce.com
  2. Login to your WordPress Admin.
  3. Go to: Plugins > Add New from the left-hand menu
  4. Select Upload, then Browse to select the zip file from your computer.
  5. Select OK and select Install Now.
  6. Activate the plugin.

Setup and Configuration

↑ Back to top

To configure the plugin, go to: WooCommerce > Settings > Products > General.

On this page, you’ll find a Product Finder section and be able to select which product criteria (category/attributes) appear as options in the Product Finder form. You can also select which criterion is selected by default when the form loads.

Note: Only Global Attributes and Product Categories can be used for filtering – product specific attributes will not be taken into consideration.
product-finder-attributes

This affects all instances of the Product Finder on your site. But if you specify the parameters outlined below when using the shortcode, template tag, or action hook, then you can override these settings.

Usage

↑ Back to top

The Product Finder can be displayed in four ways – each method can override settings using specific parameters:

1. Widget

↑ Back to top

This is the simplest method for displaying the Product Finder – all you need to do is add the ‘WooCommerce Product Finder’ widget to any widget area of your site, and it will be displayed where you want it to appear. When adding the widget, you can set the criteria that are made available to customers.

The Product Finder widget settings
The Product Finder widget settings
Note: This does not account for subcategories or WooCommerce Brands.

2. Shortcode

↑ Back to top

The Product Finder shortcode is: [woocommerce_product_finder]. Using the shortcode without parameters will display the Product Finder based on options selected in the settings panel.

Parameters

Shortcode parameters are ‘use_category’ and ‘search_attributes’ and can be used as follows:

  • use_category: Can be ‘yes’ or ‘no’
  • search_attributes: This is a comma-separated list of slugs of all attributes you would like to include in this instance of the Product Finder

Example

This displays a Product Finder form that does not include the product category and only shows the genre, size, and color attributes as options:
[woocommerce_product_finder use_category=”no” search_attributes=”genre,size,colour”]

3. Template Tag

↑ Back to top

The Product Finder template tag is: woocommerce_product_finder(). Using this function without parameters will display the Product Finder based on options selected in the settings panel.

Parameters

The template tag parameters are use_category and search_attributes  and must both be passed in the same argument as an array and can be used as follows:

  • use_category: Can be either boolean true or false
  • search_attributes: This is an array of the slugs of all the attributes that you would like to include in this instance of the Product Finder

You can also pass a second argument ($echo) to the function that dictates whether to return the Product Search form or to echo it out directly. If you would like to return the form to store a variable, then this must be set to boolean false; setting it to boolean true or excluding this argument will echo the form out.

Example

This displays a Product Finder form that does not include the product category and only shows the genre, size, and color attributes as options:

woocommerce_product_finder( array( 'use_category' => false , 'search_attributes' => array( 'genre' , 'size' , 'colour' ) ) );

4. Action Hook

↑ Back to top

The Product Finder action hook is: do_action( 'woocommerce_product_finder' ). Using this hook without parameters will display the Product Finder based on the options selected in the settings panel.

Parameters

Action hook parameters are use_category and search_attributes  and must both be passed in the same argument as an array and can be used as follows:

  • use_category: Can be either boolean true or false
  • search_attributes: This is an array of the slugs of all the attributes that you would like to include in this instance of the Product Finder

Example

This displays a Product Finder form that does not include the product category and only shows the genre, size, and color attributes as options:

do_action( 'woocommerce_product_finder' , array( 'use_category' => false , 'search_attributes' => array( 'genre' , 'size' , 'colour' ) ) );
The Product Finder displayed alongside its search results
The Product Finder displayed alongside search results
  • 30-day money-back guarantee
  • Support teams across the world
  • Safe and secure online payment