Hi,
@brutex
I have created the solution for this, code is below, Hope it may help you
also, you can change variables according to your requirement.
Put this code in your custom taxonomy archive page.
$term_id = get_queried_object()->term_id;
$products = get_posts(array(
'post_type' => 'product', //put post-type slug here
'post_status' => 'publish',
'numberposts' => -1,
'tax_query' => array(
array(
'taxonomy' => 'product_cat', //put taxonomy slug here
'field' => 'id',
'terms' => $term_id,
'include_children' => true
)
)
));
$value1 = array();
foreach($products as $product){
$product_id = $product->ID;
$value1[] = get_post_meta($product_id,'value1',true); // mata key = value1
}
$max_price = max($value1); // result
Thanks.