WC_Product_Grouped::get_max_pricepublicWC 10.1.0

Get the maximum price from visible child products.

Method of the class: WC_Product_Grouped{}

No Hooks.

Returns

String. Maximum price or empty string if no children

Usage

$WC_Product_Grouped = new WC_Product_Grouped();
$WC_Product_Grouped->get_max_price();

Changelog

Since 10.1.0 Introduced.

WC_Product_Grouped::get_max_price() code WC 10.3.6

public function get_max_price() {
	$children = array_filter( array_map( 'wc_get_product', $this->get_children() ), 'wc_products_array_filter_visible_grouped' );
	$prices   = array_map( 'wc_get_price_to_display', $children );

	if ( empty( $prices ) ) {
		return '';
	}

	return wc_format_decimal( max( $prices ) );
}