Tell us what you are trying to do? I have create one to many relation between collection and products. I have successfully listed all related products in the collection, now I want to list collection and other product in the same collection in a product page related to the particular collection
Is there any documentation that you are following?
Is there a similar example that we can see?
What is the link to your site?hidden link
Hi Nelson,
Thank you for contacting us and I'd be happy to assist.
Assuming that you have a one-to-many post-relationship "collections-products", you can get the post ID of the collection post related to the current product, using the "item" attribute like this:
( ref: https://toolset.com/documentation/user-guides/views/views-shortcodes/item-attribute/ )
[wpv-post-id item='@collections-products.parent']
Next, you can create a new post view that shows product posts, with a post-relationship query filter, that shows only those posts which are in the "Collections Products" relationship with the post whose ID is passed through a shortcode attribute "wpvrelatedto".
( ref: https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items )
You can then place this new view's shortcode in your single product page's template, like this:
[wpv-view name="slug-of-view" wpvrelatedto="[wpv-post-id item='@collections-products.parent']"]
Please update "slug-of-view" and "collections-products" slugs with the actual slugs used on your website.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
My issue is resolved now. Thank you!