1. Documentation /
  2. WooCommerce Product Search /
  3. Version 1.x and WooCommerce 2.x /
  4. Setup

Setup

Setup and Configuration

↑ Back to top
The extension can be used directly without any specific setup. Simply add its widget to a sidebar and it’s ready to use. But there are extended features that you might want to use, so we suggest to have a look at the sections below for details. 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 review the configuration settings go to WooCommerce > Settings > Search. There you have several sections with their related settings.
  • Weights : Enabling the use of weights will improve relevance in product search results. Weights can also be set for specific products and product categories.
  • Thumbnails : Presents configuration options related to thumbnails. These are related to the [woocommerce_product_search] shortcode, the plugin’s search widget and its API functions for use in templates.
  • CSS : This section allows to adjust settings related to stylesheets and styles used with the extension’s shortcode, widget and API functions.
  • Performance : Here you can enable Full Text Search.

Search Weights

↑ Back to top
Settings - Search Weights improve the relevance in product search results, based on search keyword matches in product titles, excerpts (product short descriptions), contents and tags. Weights can also be set for specific products and product categories, to fine-tune the order in which products appear in product search results. The use of Search Weights can have a significant impact on the relevance of product search results. You must enable the option to use weights before they are taken into account and the additional settings for search weights are displayed when products and product categories are edited. To enable the use of weights, go to WooCommerce > Settings > Search, check the option Use weights and save the settings. Settings - Search Weight Note that when we refer to weights within the context of this extension, we refer to search weights only and never to the actual physical weight of a product.

Products

↑ Back to top
If search weights are enabled, their value can be adjusted individually for each product. Positive values will promote the relevance of a product when it appears in product search results, while negative values will demote it. If a product’s search weight is set to 0 or is not specified, its relevance is determined by the general values for matching keywords only. Product Search Weight To set the search weight of a specific product, go to Products and edit the desired product. Under Product Data > Search, adjust the Search Weight. The value will be added to the product’s sum of weights when it appears in product search results and will adjust its position with respect to the search weights of other products that also appear as results.

Product Categories

↑ Back to top
If enabled, search weights can be set for product categories. These are used to adjust the relevance of all products that belong to a category. Category Search Weight To set the search weight of a category, go to Products > Categories and edit the desired category. Set a positive value to promote all products in the category or a negative value to demote them. The value is added to the product’s sum of weights similar to how a product’s individual search weight impacts its overall relevance. If a product belongs to several categories for which weights have been set, the maximum value is taken into account. For example, if a product belongs to Category A with a search weight set to 100 and Category B’s search weight 200, the product’s category search weight will be 200.

Relevance

↑ Back to top
The weight settings determine the relevance of matches in the product title, short description (excerpt), its content and its related tags. Weights can be set for the following product elements:
  • Title – this affects the relevance of a product when its title matches one or more search keywords
  • Excerpt – for matching keywords in the product’s short description
  • Content – when matching search keywords are found in the product’s content
  • Tags – where search keywords match tags that are related to a product
By default, a set of weights is provided which assign a higher relevance to products with matches in the title, short description or related tags, while leaving matches in the product content at their default. Settings - Enable Weights The relatively high title weight will promote search results that have matches in the title substantially compared to matches in the excerpt or tags. Note that the search weight of products and product categories can be modified individually, the computed sum of weights determines the relevance of a product in search results.

Thumbnails

↑ Back to top
Settings - Thumbnails These settings are related to the [woocommerce_product_search] shortcode, the WooCommerce Instant Product Search widget and the extension’s API functions for use in templates. Search results are normally presented by showing the product thumbnail and title. The following options related to thumbnails can be set here:
  • Width
  • Height
  • Crop thumbnails
  • Placeholder thumbnails
The thumbnail width and height are the dimensions of the product thumbnails shown in search results produced by this plugins API functions, shortcodes and widgets. The thumbnail images can be cropped to match the dimensions exactly if the option is enabled. Placeholder thumbnails, if enabled, will show a default placeholder thumbnail image for products without a featured product image.

CSS

↑ Back to top
Settings - CSS These settings are related to the [woocommerce_product_search] shortcode, the WooCommerce Instant Product Search widget and the extension’s API functions for use in templates. The plugin loads a standard stylesheet by default. The stylesheet contains a set of CSS rules that are intended to provide a neutral presentation of the search field and its search results.

Standard Stylesheet

↑ Back to top
This option allows to deactivate the standard stylesheet if you rather desire to use your own styles defined in a another stylesheet. The standard stylesheet is only loaded when the product search is displayed using a shortcode, widget or template function provided by the plugin’s API.

Inline Styles

↑ Back to top
Inline styles can also be defined here directly. This can be used to adjust the styles without the need to modify a stylesheet. These inline styles are only used when the product search is displayed.

Performance

↑ Back to top
In this section you can enable MySQL’s Full-Text Search Functions to find search results with performance improvements. To enable it, the extension needs to create several indexes. Please make a full backup of your site and database before creating these indexes. Once you have made your backup, you can proceed and click the Create Indexes button. For large sites, it is recommended to do this during low traffic hours as it may take some time to complete. Once the indexes have been created, you can enable Full-Text Search. A Wildcard mode can also be enabled to extend the results to partial matches. You can disable Full-Text Search and remove the indexes that the extension has created. Click Index removal and the relevant options to do this are displayed.

WPML

↑ Back to top
Language-specific filtering of search results is disabled by default. If you plan to use the search facility with WPML and language-specific versions of products, you can enable language-specific filtering. Please refer to the sections on shortcode attributes, widget options and template functions.