Skip Navigation

[Resolved] Creating View to Display Fields from 2 Post Types in Many to Many Relationship

This support ticket is created 3 years, 4 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/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Kirk 3 years, 4 months ago.

Assisted by: Waqar.

Author
Posts
#1854307
toolset-package-deals-201124.jpg

I have created a many to many relationship for 2 post types, Package Deals and Products.

I have tried to follow the instructions for creating a view for Package Deals that shows information from both the Package Deals and Products post types.

When I try and create the view it does not show the indented related post products under the Package Deals post type (see attached image).

I know I am doing something incorrectly, however, have no idea what it is.

Thanks for any assistance you can offer.

Kirk

#1854409

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Kirk,

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

To suggest the best way to achieve this, I'll need to fully understand exactly where and how you're planning to show this view.

Can you please share temporary admin login details, along with the example page where this view can be seen?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1854501

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for sharing these details.

To achieve this, you'll need nested views, which are not currently supported through the views created using the new Blocks editor.

First, you'll enable the classic/legacy views editor by selecting the option "Show both the legacy and Blocks interface and let me choose which to use for each item I build" for the editing experience.
( at WP Admin -> Toolset -> Settings -> General )

This will enable the views management section at WP Admin -> Toolset -> Views, from where the classic/legacy views can be added/edited.

The first parent view will be set to show the "Package Deal" posts and inside its loop, you can show any field data from this post type.

The second child view will be nested inside the loop of the first view and will be set to show the "Products" posts, which are related to the current post in the loop. In the loop of this second view, you can show any information that you need from the related product.

Here is a guide on using the nested views:
https://toolset.com/documentation/user-guides/views/using-a-child-view-in-a-taxonomy-view-layout/

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

#1856389

My issue is resolved now. Thank you!

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