Forums › Forums › Search & Filter Pro › Date filter always produces zero results
Tagged: date filter issue
- This topic has 22 replies, 3 voices, and was last updated 4 years, 5 months ago by Ross.
-
Ross Moderator(Private) June 5, 2020 at 2:36 pm #247671
Hi Boris
I’m not getting any results, because your post meta slider
compare
is not set to the correct setting…Thanks
Ross Moderator(Private) June 5, 2020 at 3:08 pm #247687Hi Boris
The page we are looking at: https://ispacetest.nl/alle-accommodaties/
Has the slider for min / max occupancy… but the compare mode is wrong, it is not what we have been discussing, causing the default search to return no results, meaning I cannot test the date, because I cannot do a basic search as the field is setup incorrectly.
Thanks
Anonymous(Private) June 5, 2020 at 4:14 pm #247699Hi Ross,
I thought I had set the min-max field exactly as you suggested. I probably have things mixed up with the live website. I set it to overlap on the staging site, now it does work as intended, the date also.
But the live website still doesn’t. I don’t see any difference in the settings.
Ross Moderator(Private) June 8, 2020 at 8:43 am #247778Hi Boris
I would try to get the live site like staging, so disable the plugins that are disabled on staging, rebuild the cache, and test again.
If that doesn’t work, can you remove the date filter on live? Is the search form working as expected without dates on live?
Thanks
Anonymous(Private) June 9, 2020 at 10:27 am #247989Hi Ross,
yes, it’s very strange.– the availability for each accommodation can be found here: WP-admin > Hbook > Rates. You can see that each accommodation is connected to seasons and rates there.
– the results I expect to see, you can find here: WP-admin > Hbook > Reservations
If you take 15-22 june for example, you can see that everything not green and not pink is available. That means every accommodation except:
– casa kümpel
– villa sonnata
– villa wald (all of them)
– cottage wald
– casa drei mädelRoss Moderator(Private) June 10, 2020 at 11:45 am #248198Hi Boris
So I took another look today, and now it doesn’t show any result at all….
I have no idea whats going on, but changes are being made, and I am unable to keep track of this / support this.
I have once again, disabled the theme, and found things to be working better, which leads me to believe code changes are occuring to the theme.
Anyway, now I have reduced your search form back to basics, and we are least getting correct results for the slider, I am analysing the dates.
So.. from what I can see the logic is wrong for your date field.
You want the user to search for dates, but exclude unavailable dates?
Well, what you have done is a create a date range field, that searches FOR unavailable dates.
What you would need to do, is have some post data, with AVAILABLE dates, (even if that is some fake value, such as available from 10 years ago, and available 10 in years in the future – and use that as a min / max for your field)
Then you will need to use our filter
sf_edit_query_args
– https://searchandfilter.com/documentation/action-filter-reference/#edit-query-argumentsAnd create a meta query, that excludes unavailable dates from the query. This will be quite complicted to achieve, however, your developer should be able to tackle this.
Let me know if there is any confusion on the above.
A request please, if we are going to continue working on this issue, please do so using staging, the default theme, my test search form, and using my results template that I added to the default theme (which outputs the necessary data for me to see whats happening) and DO NOT make any code changes to this theme (if you have to, to add the sf_edit_quer_args filter, please explain clearly what was changed and where).
Thanks
Anonymous(Private) June 10, 2020 at 1:39 pm #248263Hi Ross,
I really appreciate your help in this. The date filter: Yes, your assumption is correct. What it is supposed to do, is filter for availability. The visitor selects a check-in and check-out date, and the result should show all the accommodations that are available within that time period.
I will check with my developer and let you know.
Thanks!
Boris -
AuthorPosts