Hi Mai,
I'm not sure why the developers told you that this isn't possible. To make sure there is no misunderstanding in the communication, I'm going to share a summary of the current setup, your requirement, and some pointers on how this can be done:
1. Setup:
- When a host user creates a "Camp" post where he/she is the author through a Toolset Form, it also creates a WooCommerce "Product" of the same name. At the same time, the form also connects the created "Camp" and the "Product" posts through the "Camp Products" relationship.
- For someone to join or make a booking for a camp, he/she needs to place a WooCommerce order for that Product.
2. Requirement:
What you need now is a page for the host, where he/she can see the list of his/her camps, along with the bookings or orders placed for those camps.
3. Solution:
- Using a Toolset view, you can show the list of all the Camp posts from the host, by using the author filter.
( i.e. show all the camp posts where the currently logged-in user is the author )
Up to this part, you don't even need any custom code.
- Once you're inside the individual host's Camp post loop, you have the ID of the camp post. This means that you can also get the ID of the connected "Product" post from the "Camp Products" relationship.
( for this part you can either use a nested view with a relationship filter or use the "toolset_get_related_posts" function: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_posts )
- When you know the ID of the host's "Product" post, you can use some custom code the get the list of all the bookings or orders for that particular product.
You'll find a number of snippets and suggestions for this part online:
hidden link
https://stackoverflow.com/questions/45848249/woocommerce-get-all-orders-for-a-product
I hope this summary will help in discussion with the developers and for someone proficient with PHP, WordPress, Toolset, and WooCommerce, this shouldn't be too challenging.
Note: If you're finding this current structure and customization too much work, you can always consider switching to third-party, pre-built booking plugins:
hidden link
hidden link
regards,
Waqar