General settings

The plugin can be used in 3 ways:

  • with YITH WooCommerce Product Search widget
  • with the specific shortcode [yith_woocommerce_ajax_search]
  • by inserting in the template the following php code
    <?php echo do_shortcode('[yith_woocommerce_ajax_search]');?>

Widget

To add the search form through the widget, click on “Appearance -> Widgets” and add the “YITH WooCommerce Product Search” widget to the sidebar as shown in the example.

Widget

The widget has two options:

  • Template wide: if enabled, the form will adjust to the whole width of the page
  • Filter above: by default all the field forms are arranged on a unique line.
    By enabling this option, the search box will be arranged on a different line in relation to other possible available fields (category list and filter for search field).

Widget view

Settings

By clicking on YITH Plugins -> Ajax Search from WordPress dashboard you will find the settings dashboard where you can set up some parameters of the plugin.

General settings

In “General settings” you can set up the following options:

  • search box label
  • search button label
  • minimum number of requested characters to launch Ajax Search
  • maximum number of displayed results in the box

Additional Features

Additional features

The above described section could be unavailable if the theme doesn’t support the specific features.
Provided options allow user to choose the filters to apply to contents search:

  • “Show filter for search fields”: allows to extend the search to all site contents or only to products

"Show filter for search fields"

  • “Show the category list”: allows to filter search results on the strength of a selected category, filter on category even without typing a keyword.Show the category list

Search form

“Search” section of settings dashboard includes the complete list of options through which you can set up search ajax parameters on the site.

search settings

Search can be extended to the following components:

  • all site contents or only products
  • articles excerpt
  • posts and pages content
  • product categories
  • product tag
  • custom field
  • product identifier (SKU)

“Multiple Word Search” option allows to show those site components that include all or one of the key words inserted by users.

With the “Hide out of stock products” enabled, you will only search for products that are in stock.

Cache result in transient

To speed the search of the contents on your site, you can use some transients and enable the “Enable transients to cache autocomplete results” entry.

 

Cache transients

The result of each search query is stored in a transient for the same duration you set.
This way, if a search is applied before the transient expiration, the system will fastly recover the result previously obtained.

options search

Order by

The search results can be sorted basing on the related post type.
Enable the “Enable order by post type” option and select the products and post & pages you want to show first.

Order Options

Output

Output

“Output” page includes the options to select single products information to show, obtained from image search (size and position) or price search.

Product information

You can show the form in two different templates: the default one or the “Wide” style one which takes up the whole available space in width.

Form template
Template view

In case of on sale or highlighted products (“featured” products), a badge will be applied to results.

Sale badge

Out-of-stock badge

Options allow you to change style and colors of shown badges.

Style and colors

Title & Excerpt section allows to show product excerpt, to customize text length and title color.

Title & Excerpt

Title & Excerpt view

By activating “View All” Link option, a link will be added to the bottom of search results section. In this way users can check the page that includes all components of their search parameters.

View all

View all option