Forums › Forums › Search & Filter Pro › Post Meta range slider not working as expected – take 2
Tagged: Compare mode, maximum occupancy, post meta, range slider
- This topic has 27 replies, 3 voices, and was last updated 4 years, 5 months ago by Ross.
-
Ross Moderator(Private) June 4, 2020 at 12:39 pm #247395
Hi Boris
This behaviour is correct.
You’ve set the range (EDIT, I could have done this…) field to check from two meta values, a min and max, and you’ve set the compare mode
to any overlap
So Chalet Underhill, has a range
1-9
, and choosing1-8
in the search form overlaps with the meta range, so it is shown.You might want to change this to just using max_occupancy, and tick the
use same for end key
box.I hope that’s clear?
Thanks
Anonymous(Private) June 4, 2020 at 4:40 pm #247469Hi Ross,
actually, I started out that way (both set to max), but that also gave unexpected results, which is why I changed it to min-max, hoping that would work.What I want is that the accommodation is displayed when the slider is between 1 (that’s very accommodation) and the maximum number of allowed guests. Including the maximum number.
Can you tell me how to set it up so that it will work that way? The settings for start and end key as well as compare mode are not 100% clear to me, and I could not find any documentation on it.
Kind regards,
BorisRoss Moderator(Private) June 4, 2020 at 6:54 pm #247500Hi Boris
So that would mean changing the setting
compare mode
toinput must be between the post meta range
which I’ve done here:
https://ispacetest.nl/alle-accommodaties/?_sfm_accom_min_occupancy=1+1So the user input, will match, if it is between the post meta values of the post, if there is a match, the post is shown.
The issue with this approach is, the default slider when setup, will be
1 - 13
– so if a user submits the form without changing the slider, there are no posts that match this condition.I think the best approach it was just before –
any overlap
– which means that if the range the user has input, crosses the range on the post, the post is shown.I think logically this makes sense for a user (you can tell me if I’m wrong in your particular setup!)
Lets say I want to search for accomodation that sleeps 1 – 6 people, I want to see all possible options, including those that sleep
1 - 20
people, at the end of the day, it meets my requirements of1 - 6
(although it does sleep more than needed) so could be a viable option?Anyway, let me know your thoughts and if what I’m saying is making sense!
Best
Anonymous(Private) June 5, 2020 at 7:44 am #247525Hi Ross,
what you are saying makes sense. The option of not setting the filter and then not getting results is not an option.
So back to the original setting. Most likely, visitors will not change the maximum number, but they will change the minimum number. If that is set to 6, all accommodations housing 1-6 people should also be in the results.
So if I set it up like that (min-max, any overlap, 1-13 guests) on the test system, it works. But on the live website, it doesn’t. What do I need to change to make that work?
Regards,
BorisAnonymous(Private) June 5, 2020 at 9:38 am #247558Hi Ross,
I’ve done the following:
– set up the beta plugin (without modifications),
– set the post meta slider fields correctly for all languages,
– rebuilt the S&F cache
– updated all plugins
– removed all caching stuff from htaccessI tested with all languages on Chrome with caching disabled and enabled. It all works!
Ross Moderator(Private) June 5, 2020 at 10:55 am #247567Great stuff, glad we finally moved past this issue 🙂 I’ll close this, and update on the other thread shortly.
Best
-
AuthorPosts