B
B
Boris Belov2017-08-03 16:35:53
WordPress
Boris Belov, 2017-08-03 16:35:53

Is it possible to get the ID of the parent grouped product?

Hello.
I'm making a rather interesting custom thing on Wookcommerce.
It is necessary to get the ID of the product, which is a "group".
For example, there is a product: "Box of toys". Group product.
Inside, I attached the goods "Toy 1", "Toy 2", "Toy 3".
How do I get the name or ID of the parent product "Toy box" now?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr Crabbz, 2017-08-03
@Punkie

https://docs.woocommerce.com/wc-apidocs/class-WC_P...
get_parent_id of the wc_product object.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question