This site uses cookies and similar technologies.

If you don't change browser settings, you agree to it.

I understand
317 Posts
Kenneth
6 months ago
Topic

Hi. I've got 50+ products with a spread price range. What I want to do is to have a filter where I've preset three price categories.

I.E 0 - 300, 300 - 600, above 600

So when selecting one of these, the items will be filtered. I belive this can be done with the slider field, but is it possible to do so with simple select, radio and checkboxes as well?

Get a VIP membership
4228 Posts
Kadministrator
6 months ago
5
Level 1

You would need to use the right combination of radio values and matching or if this does not work directly, use conditionals to set values on a pair of text fields (I believe this is what slider does)

317 Posts
Kenneth
6 months ago
4
Level 2

Thanks for the suggestion, but I'm not completly sure how you mean. How would I go about to setup this?

4228 Posts
Kadministrator
6 months ago
3
Level 3

First option would work if you would have value with BETWEEN , but I am not sure there is a matching mode that would allow this.

With second one you would set radio value to a pair of values eg. "3,50", than using conditionals/computation copy this value 3 to one text field and 50 to another one with matching set to smaller than and larger than on second one.

317 Posts
Kenneth
6 months ago
2
Level 4

Hm. Okay. Thanks. I guess your second one is a good one to try.

Also: Could it be possible to do it like this:

Have a radio field with the ranges. Then setup conditionals to controll two fields that filter in the search form, based on fixed values which then is enabled depending on the radio selection. Or does this demand that the search list is refreshed to work?

4228 Posts
Kadministrator
6 months ago
1
Level 5

yes, your variant would also work, conditionals are client side (javascript), so no refresh is needed to set search values, but to get the filtered results that would be of-course required. You could simply add some javascript that would trigger submit after this radio value has changed. 

317 Posts
Kenneth
6 months ago
0
Level 6

Thanks. I will try to setup something and share a solution if I find one.

317 Posts
Kenneth
6 months ago
0
Level 1

Hi. I found a solution, and some limitations.

When using conditionals, this is a sad reality: "Note: The same field can't be used more than one time in the same condition group."

I first setup a range_lower and a range_higher with the same storage as the field I want to filter. Then a third radio field, with the 3 different ranges. The idea was to change value of range_lower and range_higher depending on the third radio fields selection. But, because of the same field only being able to be used one time it only works with the last condition. 

So what I will use as a solution is restriction. I will add three pairs of fields with the values I want to filter on, and limit these fields depending on a url variable triggered by the radio field. I haven't set it up, yet, but I'm quite confident that this will work. Will check back if it's not working.

317 Posts
Kenneth
6 months ago
0
Level 1

Found an old post with a solution. Ranges can be created with the use of three fields and conditionals.

One to select the ranges (radio, simple select) and two to be setup with conditionals that update the value of the fields (with same storage as the field you want to filter on) whenever the radio, simple select field changes. 

Also, matchtype should be set according to what you want to do.

The important factor that allowed this to work was to check off the checkboxes in the field settings. See attached image. 

Get a Book for SEBLOD