Skip Navigation

[Resolved] Need front end filter to search by date ranges of trips

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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9: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/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Waqar 2 months, 2 weeks ago.

Assisted by: Waqar.

Author
Posts
#2696549

We're using custom posts to feature trip locations on our website which users can sign up for. Some of these trips have multiple dates, for instance, a trip may be going to Canada from May 4-15, June 25-30, etc. We want users to be able to filter the displayed trips by the date ranges that work for them. So, if a user wants to go on a trip during May, we want them to be able to filter the results down to only show trips that have viable dates during May. What would be the best way to accomplish this since each post can have multiple date ranges?

#2696712

Hi,

Thank you for contacting us and I'd be happy to assist.

For a structure where the trips can have multiple instances, you can use the 'Repeating Field Group' feature:
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/

Your 'Trips' post type will have a repeating field group 'Trip Dates'. This repeating field group will have two date-type custom fields:

1). Trip Start Date
2). Trip End Date

When creating a search view for these trips, you'll select the repeating field group post type and not the 'Trips' post type.

I hope this helps and please let me know if you need further assistance.

regards,
Waqar

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.