Fix coupon checks in cart

This commit is contained in:
thenbrent 2013-09-18 16:49:29 -07:00
parent ee0ea942d7
commit 13e337b82d
1 changed files with 2 additions and 2 deletions

View File

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