Skip Navigation

[Resolved] Create an availability calendar and filter based on start and end dates

This support ticket is created 4 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 4 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1737635

This is for a project in development so no url at this time. I am building a site that will have several vacation rental units. Each unit will have days where it's is booked and not available and other days that it is available. I'd like to be able to have an filter for date of arrival and date of departure and show the units that have all dates available in that range. This is similar to sites like Expedia where you put in your dates and it will return lodging that is available for those dates. Is this doable with Toolset? Toolset and another plugin? If there is some documentation of a forum thread on this already I'd appreciate a link. Thanks!

#1739345

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Basically - if you have start date and end date setup as custom field, you can add the those start and end date custom field as filters to your custom search view and it will return the results/posts that falls within the selected date range.

Please check the following Docs about how you can build the custom search:
=> https://toolset.com/course-lesson/creating-a-custom-search/

#1739355

Thanks for the reply. I understand that would work if a unit had a date. But instead units have many dates that they are available for. For example For September the unit is available to be booked the 1st through the 15th of that month. But if somebody books it for the 2nd, & 3rd, those dates would no longer be available. So if a user were to search for Arriving the 1st and departing the 5th, the 2nd and 3rd wouldn't be available and so I wouldn't want the unit to show in that search. Is that doable? or would I need an additional plugin, or will this require custom coding? If custom coding, are there hooks, or developer docs? Thanks.

#1741891

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

So - the example you gave here applies to single unit search.

Basically, using View/Blocks you can add custom date filter as text, date-picker. Where there is no control over as it will simply allow the user to select the dates and based on the selected date it will filter the results.

Do you want to create search for single unit or multiple units?

Because - if you go for multiple units - lets consider all of the following units are available to be booked the 1st through the 15th of that month.
- Unit A - is booked for the 2nd, & 3rd
- Unit B - is booked for the 4th, & 5th
- Unit C - is booked for the 7th, & 8th
- Unit D - is booked for the 9th, & 10th
- Unit E- is booked for the 11th, & 12th

nor, if user search for Arriving the 1st and departing the 5th. It should display:
- It should display only unit C,D and E - correct? If yes:
That mean you want to remove the Unites that is booked that falls within the search range from your search result. Correct? If yes:

You need to run a add-on query using the view's filter hook wpv_filter_query, where you should search the Units that falls in the selected search range and add those found post's post ID as post__not_in query argument.

More info:
=> https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query