Exclude variations with 2 specific attribute terms from coupon usage in Woocommerce
问题 I need to prevent coupons being used if customer have any specific product variations in their cart with following attribute terms: attribute_pa_style => swirly attribute_pa_style => circle I've looked through the Woocommerce scripts that apply to restricting specific products and specific categories, but can't figure it out with regard to attributes and all coupons. Any help is appreciated. 回答1: This can be done using woocommerce_coupon_is_valid filter hook this way: add_filter( 'woocommerce