<body class="...">
на каждой странице категории содержит уникальные классы, как идентификатор, так и имя термина
Попробуйте что-то вроде этого
.woocommerce ul.products li.product a img {
box-shadow: 0 0 14px #aaa !important;
}
.term-utility ul.products li.product a img, .myclass-utility ul.products li.product a img {
box-shadow: 0 0 0 #aaa !important;
}
добавить пользовательский класс тела для термина (родительский) ) Утилита и Чайлдс
function my_body_classes( $classes ) {
global $post;
if ( is_product_category() ) {
$term_slug = 'utility';
$taxonomy = 'product_cat';
$term_id = get_term_by( 'slug', $term_slug, $taxonomy )->term_id; // Get the term ID
$child_ids = get_term_children( $term_id, $taxonomy ); // Get the children terms IDs
$terms_ids = array_merge( $child_ids, [$term_id] ); // an array of all term IDs (main term Id and it's children)
if ( has_term( $terms_ids, $taxonomy, $post->ID ) ) {
$classes[] = 'myclass-utility';
}
}
return $classes;
}
add_filter( 'body_class','my_body_classes' );