WC_Product_Grouped::get_max_pricepublicWC 10.1.0

Get the maximum price from visible child products.

Метод класса: WC_Product_Grouped{}

Хуков нет.

Возвращает

Строку. Maximum price or empty string if no children

Использование

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

Список изменений

С версии 10.1.0 Введена.

Код WC_Product_Grouped::get_max_price() WC 11.0.1

public function get_max_price() {
	$children = $this->get_primed_visible_children();
	$prices   = array_map( 'wc_get_price_to_display', $children );

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

	return wc_format_decimal( max( $prices ) );
}