WC_Product_Grouped::get_min_price
Get the minimum price from visible child products.
Method of the class: WC_Product_Grouped{}
No Hooks.
Returns
String. Minimum price or empty string if no children
Usage
$WC_Product_Grouped = new WC_Product_Grouped(); $WC_Product_Grouped->get_min_price();
Changelog
| Since 10.1.0 | Introduced. |
WC_Product_Grouped::get_min_price() WC Product Grouped::get min price code WC 10.3.6
public function get_min_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( min( $prices ) );
}