["id_iiko_категории"]
Ну треш же, не надо называть кириллицей переменные и элементы массива, а в этом случае там вообще просто id надо _product_attributes
$args = [
'post_type' => 'product',
'meta_query' => [
[
'key' => '_product_attributes',
'value' => 'blue',
]
]
];
$query = new WP_Query($args);
function product_category_max_min_price($term){
global $wpdb;
$results = $wpdb->get_col( "
SELECT pm.meta_value
FROM {$wpdb->prefix}term_relationships as tr
INNER JOIN {$wpdb->prefix}term_taxonomy as tt ON tr.term_taxonomy_id = tt.term_taxonomy_id
INNER JOIN {$wpdb->prefix}terms as t ON tr.term_taxonomy_id = t.term_id
INNER JOIN {$wpdb->prefix}postmeta as pm ON tr.object_id = pm.post_id
WHERE tt.taxonomy LIKE 'product_cat'
AND t.term_id = {$term->term_id}
AND pm.meta_key = '_price'
");
sort($results, SORT_NUMERIC);
return [
'min' => current($results),
'max' = end($results)
];
}