Range selection is the default filter type for the Products Prices and Products Rating filter, and is also available for the meta data filters. Users of the premium version will also be able to make ranges out of their taxonomy filters, such as sizes, years, diameters etc.
There are 3 ways to setup a range. For any filter that has numeric values, such as products prices, rating, length, weight, years you can either use the automatically calculated numeric values, or custom numeric values option of your Range values setting. To create a range from the non-numeric filter terms of a taxonomy filter such as XS – S – M – L – XL sizes, use the non-numeric filter terms option of the Range values select.
Premium version users who wish to create numeric ranges out of their taxonomy filters will need to keep in mind that taxonomy ranges are filtered by the values of taxonomy terms’ slugs. Please make sure that all the terms of such taxonomies have their slugs assigned to the values that they need to be filtered by (dashes and letters before or after the numeric values are allowed). For example, if you want to create a taxonomy range out of a Years taxonomy, you will need to assign the corresponding year to each term’s slug, so that the slugs would be something like 2020, 2030 etc (slugs of type year-2020, diameter-15, 30d, j20 are also allowed).
For the decimal values to work properly in numeric taxonomy ranges, please make sure that all the relevant slugs have their decimal separator (dot/comma) replaced by the dash. For example, a taxonomy range item with the value of 3,5 should have its slug set to 3-5.
Automatically calculated numeric values
Use the Automatically calculated numeric values setting of the Range values field whenever you need a numeric range divided into equal segments. In a case like that all you need to do is to setup the minimum and maximum values of the range filter for your Woocommerce shop, and specify how many range divisions you want to have.
For example, if you need a range filter for the products prices from 0 to 100 USD, and you want to divide it into 4 equal sections of 25 USD, set the Minimum value option to 0, the Maximum value to 100, and put 4 in the Range divisions field. Push the preset settings Save button, and the range of 0 – 100 USD divided into 0 – 25 | 25 – 50 | 50 – 75 | 75 – 100 will be created for you automatically (if the Precision option is set to 0).
In case the Precision is set to 0.01, the automatically created range will become 0 – 24,99 | 25,00 – 49,99 | 50 – 74,99 | 75 – 100. You will see that if you set the number of decimals option to 2 (if the decimals are set to 0, you will see the rounded values both in previews and on shop pages, so the difference made by the Precision setting may not be visible, though it will still be there when applying filters).
Custom numeric values
If you need better control over your range divisions, you can use the Custom numeric values option of the Range values select box. Custom range will give you the power to setup your own value for each range division.
You will see a list of all the filter range values right under the Range values select box. Click on the value label to remove it from the list. Add a new value to the range by putting it into the Add value field and pushing the Add value button. After each deletion or addition values will be automatically sorted in the ascending order.
Let’s illustrate the setup of custom numeric values on an example. Say, you want to divide your range of 0 – 100 USD into the following uneven divisions: 0 – 9,99 | 10 – 49,99 | 50 – 100. You do have to have the 0 and 100 on the range scale, since they’re the left-most (minimum) and the right-most (maximum) values of the scale. Then, you will add the 10 and the 50 by entering these values into the Add value field and pushing the Add value button, and set the Precision to 0,01.
The sections’ end-values of 9,99 and the 49,99 will be calculated automatically based on the value of the Precision field according to the following formula: next range value – precision. Whenever you want you ranges to be more accurate, you can use the Precision option to make the last value of the range segment to be a little less than the first value of the next range segment. If you want the end value of the segment to be the same as the first value of the next range division, set the Precision to 0.
Keep in mind that there always have to be at least 2 values present in a range filter (the minimum and the maximum values), so you can’t delete anymore values if only 2 are left. if you need to change the minimum or the maximum value in a 2-value range, add the new value, and then delete the unneeded one.
Non-numeric filter terms
This option is available in the premium version of the plugin.
This advanced range type will allow you to build a range slider out of filter items that are not set in numbers, for example for the XS – S – M – L – XL sizes filter.
To setup range slider for non-numeric filter terms, arrange the terms in the order in which you wish to see them on the slider by dragging them by their position label. Change the terms labels as needed, then save the preset.
Please do not use this range type for large taxonomies! Also, keep in mind that if you exclude a filter item by using the Filter items control > Exclude from list setting, the excluded term will be excluded from all the filtered results.
The value of the Precision option is used to create the auto-calculated end-values of range divisions. It can help in creating more accurate ranges for price filters or ratings filters styled as radio buttons or custom icon lists.
To understand the usage of the Precision option, imagine that you have a range of 0 to 100 USD with 2 divisions. With Precision set to 0, you get the range segments of 0 – 50 | 50 – 100. If on the other hand you don’t want the first value of the next range segment to be included in the previous segment, you can set the Precision to 0.01 to achieve a range of 0 – 49,99 | 50 – 100. The end-values of all range divisions except for the last one will be calculated according to the formula value-precision (in case of our example: 50-0.01=49,99).
Number of decimals
This setting is mostly used for the formatting purposes. Whenever applicable, it controls the display of range values in the shop. You can use it if you do not wish your prices (or ratings) to display decimals: just set the setting field value to 0, and you will get rounded numbers without decimals showing in the range values.
Keep in mind that this will not change the real values of the range divisions’ labels, but will only format the decimal part of the numbers to not be seen. Still, if you want your range filters to have the label formatting of 0 – 25 | 25 – 50 | 50 – 75 | 75 – 100, you are welcome to use this setting.
The value of this field will be displayed before the range values. It can be used for the currency symbols etc.
The value of this field will be displayed after the range values. Use it for the currency symbols and the like.