Fetch child products in grouped products woocommerce

On Woocommerce version 2.5.0 get_product is already deprecated.

Use wc_get_product instead

$product_id = 8;
$product = wc_get_product($product_id);
$product->get_children();

 

Leave a Reply