Skip Navigation

[Resolved] Help displaying requests made to a user

This support ticket is created 5 years, 9 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
- 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/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1210254

Hey Guys,

Ok so real simple. I am not sure how to link bookings made to equipment (which have a relationship) to the user who owns the equipment on which the bookings were made...

So lets say, I have 2 people and the following scenario...
User 1 has equipment listed, user 2 wants to book it, so they place a booking request, and after booking it user 1 can approve/decline it. but I need a way to link the booking post type submission(cred) to the user 1 who is the owner of the equipment that was booked.

I need user 1 to be able to see a list of bookings made, with a link in the list, that links to the equipment post type (for which a relationship already exists)

#1210415

Hello,

How do you setup the relationship between post types "equipment" and "bookings"?

I assume it is one-to-many post type relationship "equipment-bookings" between post types "equipment" and "bookings".

You can try these:
1) Display a wordpress page to User 1,
2) In this wordpress page display a nested view:
- Parent post view, query "equipment" posts, filter by post's author is current logged in user,
https://toolset.com/documentation/user-guides/filtering-views-query-by-author/#post-author-is-the-same-as-the-logged-in-user
in view's loop display below child view

- Child post view, query "bookings" posts, filter by post type relationship "equipment-bookings",
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/#3-creating-a-view-that-lists-the-children-of-the-parent-post
in view's loop display a edit form link
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/

Setup above edit "bookings" form to update the "bookings" post as approved, for example update a custom field "bookings" to value 1.

#1210559

Hey Guys,

I am completely lost honestly. Would you be able to help me check what I am doing wrong?

#1210939

Yes, please provide a test site with the same problem:
1) deactivate other plugins, and switch to wordpress default theme 2019
2) provide test site credentials in below private message box, also point out the problem page URLs, thanks