Skip Navigation

[Gelöst] Display woocommerce children of a grouped product in a custom template

This support ticket is created vor 5 Jahre, 12 Monate. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von davidZ-4 vor 5 Jahre, 12 Monate.

Assistiert von: Luo Yang.

Author
Artikel
#898483

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?
versteckter Link
versteckter Link

What is the link to your site?
versteckter Link

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)
versteckter Link

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

#900244

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.

#900277

Great, this works great !
Thanks,

Dieses Ticket ist jetzt geschlossen. Wenn Sie ein Toolset Kunde sind und Hilfe benötigen, eröffnen Sie bitte ein neues Support-Ticket.