Forums › Forums › Search & Filter Pro › Age Range
Tagged: range
- This topic has 8 replies, 2 voices, and was last updated 9 years, 11 months ago by Ross.
-
Anonymous(Private) November 19, 2014 at 5:38 pm #7843
Hey, I’m loving Search Filter Pro, but just ran into a question: I can put price within a range query, but is there a way to run a range query on two fields? I have minimum age and maximum age as Advanced Custom Fields per post. Is there a way to use a single range selector to find values between those? (Say, someone wants a post for 5-7 years, but nothing before or after.) Thank you!
Ross Moderator(Private) November 19, 2014 at 9:55 pm #7852Hey John
By the sounds of it you should just be able to do the same as the price slider – just use the meta key that reflects the age range value and this should work?
Thanks
Anonymous(Private) November 19, 2014 at 10:05 pm #7859Thanks for the response. The price slider checks if a single value exists within the range. For the age range, I have *two* values I want to check the range against, a minimum and a maximum. A kids book might be appropriate for ages 5-7, so should show up on a range search for books between ages 6-18. I’d like to do this within a single range query search if possible.
Ross Moderator(Private) November 19, 2014 at 11:00 pm #7871I’m not sure this will be possible.
Can you tell me how you are creating the fields exactly, ie the settings from ACF?
Also, would you be able to provide the structure of the data that is stored? (I’m guessing this may be serialized?)
Actually if the data is serialised, and you are storing numbers (ages) it almost definitely won’t work..
Thanks
Anonymous(Private) November 21, 2014 at 12:00 am #7928Min_Age and Max_Age are two separate Advance Custom Fields, both with field type number. The rest of the settings for these fields are blank / default.
Currently I have an item listed that is recommended for 3-7 year old, so it should still show up when the range finder is set to search for items for 6-8 year olds.
Ross Moderator(Private) November 21, 2014 at 1:52 pm #7964So you would like the ability to have two sliders, one for min age, and one for max?
If you wanted a slider that would work as a slider across both those meta fields at the same time then this is not possible – the slider only takes 1 input to compare against…
Let me know if I’m following you correctly.
Thanks
Ross Moderator(Private) November 25, 2014 at 2:12 pm #8164Thats what I thought – you cannot have one slider checking against two different fields – so this is not possible I’m afraid – it can only compare directly against a single value/meta field..
I can easily see the use case for it though so will try to include this in a future update.
Thanks
-
AuthorPosts