Tell us what you are trying to do? create a woocommerce custom product template that display the children of the parent product
Is there any documentation that you are following?
https://toolset.com/learn/create-an-ecommerce-wordpress-site/single-product/
Is there a similar example that we can see?
lien caché
lien caché
What is the link to your site?
lien caché
I created a single product template and i'm trying to figure a way to display the children of these product on the parent product page.
the parent child relationship is done via woocommerce grouped product type and simple product type. the grouped product is the parent and the simple product is the child.
the relationship is set in the grouped product in the "meta:_children"
i tried to create a view that show the children by post relationship but that doesn't work.
i created a shortcode that pull the children post_id and try to create a child view that and pass the values as query string however it seems that the view can get only one id and not an array of id's.
see an example of parent product displaying one child out of two (bottom of the page)
lien caché
bid - child products array
is there a way to create a view that accept the array of product id's and display the results for only the id's that were in the array?
Please advise,
David
Dear David,
For the question:
is there a way to create a view that accept the array of product id's and display the results for only the id's that were in the array?
Yes, you can try with the Views "post ID" filter, see our document:
https://toolset.com/documentation/user-guides/filtering-views-query-by-post-id/
The post ID filter for Views allows to return or exclude one or several posts by their IDs. You can also add the IDs as a URL parameter or an attribute when you add your Views shortcode to a page.
Great, this works great !
Thanks,