Custom field selectors
Frontend Search settings -> Custom fields
Plugin version 3.5 introduces a brand new system, that allows you to create and customize custom filters on the front end. These powerful custom filters are related to custom fields.
You can choose from 6 different layout types:
- Radio buttons
- Dropdown menu
- Slider (with a single handle)
- Range slider (with two handles)
- Date filters
These filters are useful if you for example want to create a Price range slider to filter your WooCommerce products by price or Checkboxes to select whether the product is on stock or not.
You should only create one item per custom field. The items you create must have different custom field assigned.
How to create a custom selector?
The interface is designed to be as self-explanatory as possible. Here is a screenshot with further explanations:
Make sure that the operator corresponds with the custom field values. For numeric values use the numeric operators and for string values use the string operators.
As you can see, there is a wierd looking string in the Radio values box. (same goes for checkbox and dropdown values as well)
In this case each line represents one radio button. Each radio button must have a value and a label, so the syntax is the following:
value||The label string
or, if you want it to be selected by default, then:
value||The label string**
- The value
- then two vertical bar characters "||" as separators
- then the label
- and optionally two star characters "**" if you want this option to be selected by default
The default values will output the following on the frontend:
Empty values (ignore filter)
If you wish to "ignore" a filter or to use an "Any" selection, you can leave the value field empty. In this case, the filter won't be considered in the search process. For example:
||Any value** value1||Value 1 value2||Value 2
will produce the following output:
By selecting Any Value, the filter will be ignored.
Slider and Range slider
More or less the Radio, Checkbox and Dropdown types are similar. However the slider and the Range slider type is a bit different. These types were intended to use with NUMERIC fields only. Moreover the Range slider type uses the BETWEEN operator.
Ordering the output
After hitting the "ADD" button you should see your item added to the right grey area:
- reorder the items you have created by dragging and dropping them
- delete them by hovering over and clicking the "delete" icon
- edit them by clicking the "edit" icon