WordPress at Your Fingertips
function is not described

WC_Product_CSV_Exporter::get_column_value_grouped_products() protected WC 3.1.0

Get grouped_products value.

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

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_column_value_grouped_products( $product );
$product(WC_Product) (required)
Product being exported.

Changelog

Since 3.1.0 Introduced.

Code of WC_Product_CSV_Exporter::get_column_value_grouped_products() WC 5.9.0

protected function get_column_value_grouped_products( $product ) {
	if ( 'grouped' !== $product->get_type() ) {
		return '';
	}

	$grouped_products = array();
	$child_ids        = $product->get_children( 'edit' );
	foreach ( $child_ids as $child_id ) {
		$child = wc_get_product( $child_id );
		if ( ! $child ) {
			continue;
		}

		$grouped_products[] = $child->get_sku( 'edit' ) ? $child->get_sku( 'edit' ) : 'id:' . $child_id;
	}
	return $this->implode_values( $grouped_products );
}