Number Range

Allow users to filter content based on a numerical field value. This facet might consist of three elements: “max” and “min” input boxes, a slider, and a range presented as a “radio” button. In the settings, you can decide what elements will be displayed.

The number range filter type will be selected automatically if you pick “price” as the filter source.

The range filter type will be able to select only if the filter data source consists of numeric values. FiboFilters will first analyze this data, and then allow filter selection that corresponds with the data.

Number range with prices
A Number range with prices

Available options

Option nameDescription
Data sourceThe Number Range filter type is only available for data sources that have numerical values. FiboFilters automatically analyzes the data sources to hide filter types that do not match certain criteria.

Read more about data sources.
When to showAlways – a filter will always be displayed

Auto – a filter will be visible conditionally. Read more about content-aware filters.

This option will be hidden when “Price” is the source. Prices are always displayed.
Display radio rangesIt shows or hides the “Radio ranges” element. These are automatically calculated numerical ranges that will vary depending on the available products for filtering.

Number range filter - ranges
Display “Min/Max” inputsDisplays or hides the “Max” and “Min” input boxes.

Number range filter - min/max
Display slidersDisplays or hides the “Slider” element, with which users can narrow down the search results to the set numerical range.

Number range - slider
Display the filter name in applied filtersIf the user sets a number range, it will also be displayed above the products in a special section called “Applied filters”.

With this option enabled, the “Filter name”, “Min. value” and “Max. value” will be displayed as shown in the screenshot below. Inversely, when the option is disabled, only the “Min. value” and “Max. value” will be shown.
Number range - applied filters

Number format

The price format is set automatically, according to WooCommerce settingsGeneralCurrency Options.

For values different from price, the thousands separator and decimal point are taken from the global variable $wp_locale. They can be overridden using a PHP snippet:

add_filter( 'fibofilters/config/number_format', function ( $number_format ) {
    return [
       'thousands_sep' => ' ',
       'decimal_point' => ',',
    ];
} );

Depending on the filter’s purpose, you might want to display numeric values with a prefix, for example, ~50 (approximately 50), a suffix 70dB (70 decibels), or with a number precision 15.00 (two digits after decimal).

These values can also be changed with a PHP snippet. For example, you can change the number format to ~12.0”, meaning: approximately 12 inches with 1 number precision.

add_filter( 'fibofilters/filter/get_data', function ( $data, $context ) {
    if ( $context !== 'frontend-filtering' ) {
       return $data;
    }

    if ( $data['url_slug'] === 'caps-size' && $data['type'] === 'range' ) {
       $data['number_prefix']    = '~';
       $data['number_suffix']    = '"';
       $data['number_precision'] = 1;
    }

    return $data;
}, 10, 2 );

The result looks like that:

Number range with sizes
Numbers have prefix ~, suffix " and number precision set to 1.