Hi,
one of the clients requested to display the min option price created by the PPOM radio button on Category/shop pages. So we have created a simple function so other clients can also use this.
paste following code inside your functions.php
add_filter('woocommerce_get_price_html', function($price, $product){
// Make sure you change this dataname to your field's data_name you want to extra
$data_name = 'v_lg_pris';
$field_meta = ppom_get_field_meta_by_dataname($product->get_id() , $data_name );
$options = isset($field_meta['options']) ? $field_meta['options'] : '';
if( ! $options ) return $price;
$price_range = array();
foreach($options as $option){
$price_range[] = $option['price'];
}
if( !empty($price_range) ){
$from_pice = min($price_range);
$price = sprintf(__("From %s","ppom"), ppom_price($from_pice) );
// Use this show price range
/*$to_price = max($price_range);
$price = wc_format_price_range($from_pice, $to_price);*/
}
return $price;
}, 12, 2);