WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Internal\ProductAttributesLookup

LookupDataStore::get_variations_of() private WC 1.0

Get the variations of a given variable product.

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

No Hooks.

Return

Array. An array of WC_Product_Variation objects.

Usage

// private - for code of main (parent) class only
$result = $this->get_variations_of( $product );
$product(WC_Product_Variable) (required)
The product to get the variations for.

Code of LookupDataStore::get_variations_of() WC 5.9.0

private function get_variations_of( \WC_Product_Variable $product ) {
	$variation_ids = $product->get_children();
	return array_map(
		function( $id ) {
			return WC()->call_function( 'wc_get_product', $id );
		},
		$variation_ids
	);
}