WordPress at a glance
function is not described

WC_API_Products::get_grouped_products_data() private WC 2.5.0

Get grouped products data

{} It's a method of the class: WC_API_Products{}

No Hooks.

Return

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_grouped_products_data( $product );
$product(WC_Product) (required)
-

Changelog

Since 2.5.0 Introduced.

Code of WC_API_Products::get_grouped_products_data() WC 5.0.0

<?php
private function get_grouped_products_data( $product ) {
	$products = array();

	foreach ( $product->get_children() as $child_id ) {
		$_product = wc_get_product( $child_id );

		if ( ! $_product || ! $_product->exists() ) {
			continue;
		}

		$products[] = $this->get_product_data( $_product );

	}

	return $products;
}