From 504253c909fed4d7e420e5d6ab3a45a1a7e33cbe Mon Sep 17 00:00:00 2001 From: Chris Harvey Date: Fri, 10 Oct 2014 15:44:18 +0100 Subject: [PATCH] Pass cart values to is_valid_for_product method --- includes/class-wc-cart.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-cart.php b/includes/class-wc-cart.php index 5aa21c707de..b813216d2d7 100644 --- a/includes/class-wc-cart.php +++ b/includes/class-wc-cart.php @@ -1741,7 +1741,7 @@ class WC_Cart { $coupon = new WC_Coupon( $code ); if ( $coupon->apply_before_tax() && $coupon->is_valid() ) { - if ( $coupon->is_valid_for_product( $values['data'] ) || $coupon->is_valid_for_cart() ) { + if ( $coupon->is_valid_for_product( $values['data'], $values ) || $coupon->is_valid_for_cart() ) { $discount_amount = $coupon->get_discount_amount( $price, $values, $single = true ); $price = max( $price - $discount_amount, 0 );