You can check if the product has a category by has_term
function, and it's an action hook not a filter
add_action( 'woocommerce_after_shop_loop_item_title', 'remove_woocommerce_loop_price', 2 );
function remove_woocommerce_loop_price() {
$category_name = 'the_category_name_here';
if ( has_term( $category_name, 'product_cat' ) ) {
remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_price', 10 );
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…