woothemes/woocommerce — pull request #3802 by thenbrent (2013-09-18 23:55:32+00:00)
Title: Fix coupon checks in cart

The `WC_Coupon->is_valid()` method will only ever return [`true`](https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-coupon.php#L378) or [`false`](https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-coupon.php#L391), never an instance of `WP_Error` (even if an extension returned a `WP_Error` via the [`'woocommerce_coupon_is_valid'`](https://github.com/woothemes/woocommerce/blob/master/includes/class-wc-coupon.php#L375) hook).

As a result, invalid coupons will appear valid to the cart when it checks to see if they are an instance of a `WP_Error` object in `check_cart_coupons()` & `check_customer_coupons()`.

This fixes that.