Home › Toolset Professional Support › [Resolved] Creating a booking system for specific times
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 |
---|---|---|---|---|---|---|
- | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | 12:00 – 17:00 | - |
- | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | 18:00 – 21:00 | - |
Supporter timezone: Asia/Karachi (GMT+05:00)
Related documentation:
This topic contains 12 replies, has 2 voices.
Last updated by Noman 6 years, 9 months ago.
Assisted by: Noman.
Tell us what you are trying to do?
I have a CPT called Talks - each talk has the following fields:
- Start Time
- End Time
- Topic (title)
- Room (custom taxonomy)
I want people to be able to book a days worth of talks on a cred form
So they would see:
9.30 - 10.30 Session
Room 1 - Talk A (book)
Room 2 - Talk B (book)
Room 3 - Talk C (book)
(so the idea is that these options are either a select dropdown or a set of radio buttons - so that they only choose one option.
This would repeat for a total of 6 sessions in a day: 10.30-11.30, 11.30-12.30, 14.00-15.00, 15.00-16.00, 16.00-17.00
What I have done so far:
I have assumed there will be a many to many relationship between Bookings and Talks
One talk may have many bookings and One booking will consist of many talks.
So I have created an intermediary CPT called sessions.
Sessions is a child of Bookings and Talks
However, I'm not sure how to create the overall CRED form that allows for the presentation of the time slots with a booking ability.
Is there any documentation that you are following?
https://toolset.com/documentation/beyond-the-basics/post-relationship-concepts/implementing-many-to-many-relationships/
https://toolset.com/documentation/user-guides/cred-forms-for-child-content/
https://toolset.com/documentation/user-guides/many-to-many-post-relationship/
https://toolset.com/forums/topic/can-cred-be-used-to-set-up-many-to-many-relationships/
Is there a similar example that we can see?
Gary
Hi Gary,
Thank you for contacting Toolset support. Can you please let me know why are you creating many to many relationship? Which data you want to display on single pages?
I have a simple scenario in my mind, if you can make Booking as CPT and Talk as taxonomy. So, that one booking can have multiple talks and one talk can be assigned on multiple booking. If you need specific functionality like parametric search or any other thing then please let me know. So that we can make system accordingly.
Thank you
Hi Norman,
thank you for getting back to me on this.
Unfortunately we have already created and are using talks and have the custom taxonomy of rooms for these talks. What we want to use is the existing data rather than recreate data sets that then fall out of sync or require manual updating.
If there is a way to create a custom taxonomy then from existing talks to use with the Bookings CPT that would fit to your solution. There is a thread here https://wordpress.stackexchange.com/questions/178533/convert-custom-post-types-to-custom-taxonomies on how to do that.
I'm still not sure how you would then build the cred form to achieve the result though.
Gary
Hello Gary,
If you have already talks as CPT and rooms as taxonomy then you can just create one more taxonomy for sessions and assign it to talks. So that if we need to display all talks of specific session then we can get it easily as you want to achieve:
9.30 - 10.30 Session
Room 1 - Talk A (book)
Room 2 - Talk B (book)
Room 3 - Talk C (book)
I hope it helps,
Thank you
Hi Norman,
If I take this approach then I would have a cred form with a new set of taxonomy called sessions:
The cred form would then have sections for each session? how would this be achieved?
Since talks are allocated to rooms as a taxonomy how do you present this in a cred form?
So the desired goal is
Session 9.30 - 10.30 (CPT Taxonomy)
Room 1 (CPT Taxonomy) - name of talk (CPT title)
Booking custom field (checkbox) - how does the checkbox get assigned and linked to the room taxonomy and name of talk and session.
Sorry if I'm being dumb
Gary
Hello Gary,
I have reproduced similar setup at my end and can achieve desire output with similar setup as I told you.
>> The cred form would then have sections for each session? how would this be achieved?
We will make time slots (10.30-11.30, 11.30-12.30, 14.00-15.00, 15.00-16.00, 16.00-17.00) as session taxonomy terms as you can see in attached screenshot “session terms.png”. In CRED we can display them as checkbox or dropdown as you can see in attached screenshot “cred sessions dropdown.png”.
>> Since talks are allocated to rooms as a taxonomy how do you present this in a cred form?
This can be present as dropdown or checkbox in CRED form.
Then we can make a view for session with Taxonomy filter and can achieve desire output as you can see in attached screenshot "desire output.png".
>> Booking custom field (checkbox) - how does the checkbox get assigned and linked to the room taxonomy and name of talk and session.
What is the purpose of booking custom field now? We can get specific talks/rooms using Taxonomy filter.
Thank you
Hi Norman, I have created the taxonomy sessions, created the view (see screenshots) and this is displayed on this page - hidden link it isn't showing though. If you want access to the site I can give that to you.
The cred form has this view on as well as the current terms - hidden link
It might be worth you logging into the site to view this.
Sorr
Hello Gary,
You need to select session checkbox in order to display talks of that session as you can see in attached screenshot.
If still issue persists, please provide temporary access WP-Admin Login and FTP login info to your site. Your next answer will be private which means only you and I have access to it.
=== Please backup your database and website ===
✙ I would additionally need your permission to de-activate and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important.
Thank you
Hello Gary,
I have selected 15.00 - 16.00 session from Taxonomy filter and it displaying talks of that session as we want.
hidden link
Thank you
Hi Norman, I think we may have crossed over each other on the site.
I can see the idea of what you have done. So we can create a list of posts with session and rooms.
I think I'm not being very bright here because I still can't make the leap to the next stage:
Creating a CRED form that displays:
Session 9.30 - 10.30 (with a list or check boxes of the available talks e.g. talk 1, talk 2, talk 3 and then the ability to book that talk as well as all other sessions
So the form would have 6-7 session times as above and then when the user presses submit the form books each of those sessions and the chosen talks.
Hello Gary,
I need to confirm some points before moving ahead:
1. In CRED form, do you want to display ‘Talks’ dropdown/checkbox that will display Talk CPT post titles? And user should be able to select multiple talks?
2. And for sessions, do you want to display 9.30 - 10.30, 10.30-11.30, 11.30-12.30… as checkboxes? And user should be able to select multiple sessions?
Thank you
Hi Norman, to answer your question:
1. Each Talk has a time already - this is currently a custom field - start time and finish time
Whether we use that custom post field is another thing.
The goal in a CRED form:
In a day there will be the following sessions or timings:
9.30 - 10.30 - Talk 1 Room1, Talk 2 Room 2, Talk 3 Room 3
10.30 - 11.30
11.30 - 12.30
14.00 - 15.00
15.00 - 16.00
16.00 - 17.00
For each session or timing there are more than one talk because we have 3-4 rooms.
So we need in just one CRED form to take a days booking.
A user though can only choose on talk per session e.g. say 9.30 - 10.30; they can't be in more than one room. Each sessions has a fixed number of spaces. In other words, a room has a number of chairs available.
I hope that helps.
Thank you for your help so far
Hello Gary,
As ‘Talk’ is the CPT and we can not select multiple posts(talks) in single CRED form without custom coding. And we can not consult on Custom coding & custom development as it is out of support policy (https://toolset.com/toolset-support-policy/). So we recommend to contact Toolset recommended service providers to further discuss the custom approach. We have some recommended list of service providers here if you would like to take a look: https://toolset.com/consultant/
We can make New/Edit Talk CRED form, In which user can only select 1 session and 1 room for each talk.
So result will be like this:
Talk 1 >> Session: 9.30 - 10.30 >> Room 1
Talk 2 >> Session: 9.30 - 10.30 >> Room 2
Talk 3 >> Session: 9.30 - 10.30 >> Room 3
Thank you