If the child product prices of the grouped product equal 0 show ‘POA’
Question
My grouped products currently say ‘Free’ if the child product prices are 0. I was just trying to find a way to show ‘POA’ instead.
I’ve found a way to remove the price range but cannot figure out how to replace the price with text.
add_filter( 'woocommerce_grouped_price_html', 'bbloomer_grouped_price_range_from', 10, 3 );
function bbloomer_grouped_price_range_from( $price, $product, $child_prices ) {
$prices = array( min( $child_prices ), max( $child_prices ) );
$price = $prices[0] !== $prices[1] ? sprintf( __( 'From: %1$s', 'woocommerce' ), wc_price( $prices[0] ) ) : wc_price( $prices[0] );
return $price;
}
0
1 month
0 Answers
6 views
0
Leave an answer
You must login or register to add a new answer .