Custom Restriction: Category-Specific Subtotal
add_filter( ‘woocommerce_coupon_is_valid’, ‘custom_category_subtotal_coupon_gate’, 20, 2 ); function custom_category_subtotal_coupon_gate( $valid, $coupon ) { $target_coupon = ‘your-coupon-code’; // lowercase coupon code $threshold = 5000.00; $category_ids = array( 12, 34 ); // replace with actual product category IDs if ( strtolower( $coupon->get_code() )…Continue reading