Fix coupon checks in cart
This commit is contained in:
parent
ee0ea942d7
commit
13e337b82d
|
@ -337,7 +337,7 @@ class WC_Cart {
|
|||
foreach ( $this->applied_coupons as $key => $code ) {
|
||||
$coupon = new WC_Coupon( $code );
|
||||
|
||||
if ( is_wp_error( $coupon->is_valid() ) ) {
|
||||
if ( $coupon->is_valid() ) {
|
||||
|
||||
$coupon->add_coupon_message( WC_Coupon::E_WC_COUPON_INVALID_REMOVED );
|
||||
|
||||
|
@ -401,7 +401,7 @@ class WC_Cart {
|
|||
foreach ( $this->applied_coupons as $key => $code ) {
|
||||
$coupon = new WC_Coupon( $code );
|
||||
|
||||
if ( ! is_wp_error( $coupon->is_valid() ) && is_array( $coupon->customer_email ) && sizeof( $coupon->customer_email ) > 0 ) {
|
||||
if ( $coupon->is_valid() && is_array( $coupon->customer_email ) && sizeof( $coupon->customer_email ) > 0 ) {
|
||||
|
||||
$coupon->customer_email = array_map( 'sanitize_email', $coupon->customer_email );
|
||||
|
||||
|
|
Loading…
Reference in New Issue