Skip Navigation

[Resolved] Custom Post Type – Relationship: Add a 'group' of CPT posts with a Button

This support ticket is created 3 years, 1 month 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 6 replies, has 2 voices.

Last updated by Adrian Robbins 3 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#2189019
LGSA_001.jpg

Hi

Is it possible to connect a ‘group’ of CPT records, which we have pre-created to another new CPT record, which we have linked via a Many to Many relationship?

So, for this client project we have three CPT’s - 1) Your Booking, 2) Hotels & 3) Restaurants.

Hotels and Restaurants are linked to Bookings via ‘many to many’ relationships.

All the hotel and restaurant CPT posts have been created, because they are a constant and very rarely change.

In the Booking CPT screen, which is the only CPT that has new records added (bookings) there is a Repeating Group Field for the tour days, where the detailed itinerary for each day is entered.

Below that we then have the Hotels, and Restaurant CPTs, which are added and listed via the relationship ‘link’ we have created.
It is very easy to add any number of days to a booking, which works extremely well for this project. As does the ability to add hotels and restaurants via the Connect Existing xxxxxxx Button one by one.

However for most bookings, there are a lot restaurants and sometimes a lot of hotels depending on the type of booking and the duration of the holiday tour.

So, we would like to add a new ‘button’ which would allow us to add a ‘group’ of restaurants to a booking. The same with Hotels

Rather than having to add each individual Restaurant CPT record over and over again. For somewhere like Edinburgh, there are over 30 restaurants and to add them one by one to a new booking is very time consuming and also there is the potential to inadvertently miss off a restaurant or two if distracted.

Our client is creating a lot of booking each day for the same location and therefore the ability to add a group of 30+ records by clicking a Button and selecting the ‘group’ of records is a huge time saver.

In the attached image, we have shown where we'd like to add the button.

Is it achievable?

If so, how would we go about it?

Any guidance and/or advice you can provide is very much appreciated?

Kind regards
Ade

#2189179

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Adrian,

Thank you for getting in touch.

Unfortunately there isn't a way to add a group of posts to a relationship, not without some form of custom coding.

My best advise on this is one to create a feature request so that our development team can have a look at adding something like this in the future.

To log the feature request you can go to the link below and fill out the details.
https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Thanks,
Shane

#2189617

Hi Shane

Appreciate the quick reply, and we thought this would be the case.

In your considered opinion is using 'Relationships' the best way of achieving what we require?

Or, should we be using Views within the Content Template? Would this be the more logical way to develop our system?

So, we display the Booking Details and itinerary days in a content template, and then below this data, we use a View to bring in the Hotels and then another View for the Restaurants.

At the end of the day we just want a page that displays a customers booking details, itinerary and the hotels they have booked and the recommended restaurants in their various locations on the Golf Tour.

Kind regards
Ade

#2189875

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Adrian,

In your considered opinion is using 'Relationships' the best way of achieving what we require?</b>

Based on your requirement then yes this would be the best way to approach it.

Or, should we be using Views within the Content Template? Would this be the more logical way to develop our system?

So, we display the Booking Details and itinerary days in a content template, and then below this data, we use a View to bring in the Hotels and then another View for the Restaurants.

For this i'm assuming that you would have a list of choices for the user in terms of Hotels and Restaurants and a button on each for them to add it to their itinerary. I can see this working however the user would need to click the button for each item they want to add, however the form can be submitted using AJAX.

Are they only booking the Hotels? Or are they booking both Hotel and Restaurant.

Please let me know.
Thanks,
Shane

#2190727

Hi Shane

Good to know we are on the right track 🙂

Regarding your question at the end.

All the bookings are actually made in person by one of our clients Travel Tour specialists working in conjunction with the person booking the tour, and therefore it is ONLY our client that will be using Toolset to input the booking. So, the system we are developing is basically an online itinerary reference, so the person going on the tour can quickly check what they are doing each day, where they are staying and recommended places to eat.

For years, our client has been mailing out a printed folders all round the world, which is now very expensive and the idea is that the system we are developing with them, replaces the paper copy of the itinerary and brings it online for rapid referencing - without the need to carry a bulky folder/paper copy.

However, they have a LOT of bookings each year, and we are looking for the most efficient way to input each booking and then for it to display in a highly professional and logical way for their customer to check their booking.

Kind regards
Ade

#2190903

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Adrian,

Ok so given that i've understood your usage context then yes this approach would be the best for your scenario as you've outlined in your previous thread.

Thanks,
Shane

#2192867

Hi Shane