Figured that out myself already.
is_product() && has_term( 'jackets', 'product_cat' ) || is_product_category( '30' ) || cat_is_ancestor_of( 30, get_queried_object()->term_id )
,
where ‘jackets’ has to be replaced with one’s category slug, and ’30’—with a category ID.