function template_write_accordion_block(object $term, string $category, string $img_url, string $block_txt) {
$params = array(
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'product_cat',
'field' => 'slug',
'terms' => $category
),
array(
'taxonomy' => 'тут имя вашей таксономии',
'field' => 'name',
'terms' => $term->name
)
),
);
$loop = new WP_Query( $params );
if ($loop->have_posts()) {
//echo "Есть товары";
}
wp_reset_query();
}