Pass cart values to is_valid_for_product method

This commit is contained in:
Chris Harvey 2014-10-10 15:44:18 +01:00
parent b340fd68ae
commit 504253c909
1 changed files with 1 additions and 1 deletions

View File

@ -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 );