Filter is_valid_for_product even when not relevant.

#5681
This commit is contained in:
Mike Jolley 2014-07-04 11:03:12 +01:00
parent abe0d0004a
commit 170399e5c3
1 changed files with 1 additions and 1 deletions

View File

@ -461,7 +461,7 @@ class WC_Coupon {
*/
public function is_valid_for_product( $product ) {
if ( $this->type != 'fixed_product' && $this->type != 'percent_product' )
return false;
return apply_filters( 'woocommerce_coupon_is_valid_for_product', false, $product, $this );
$valid = false;
$product_cats = wp_get_post_terms( $product->id, 'product_cat', array( "fields" => "ids" ) );