woocommerce_coupon_is_valid_for_product хук-фильтрWC 1.0

Check if a coupon is valid for a product.

Использование

add_filter( 'woocommerce_coupon_is_valid_for_product', 'wp_kama_woocommerce_coupon_is_valid_for_product_filter', 10, 3 );

/**
 * Function for `woocommerce_coupon_is_valid_for_product` filter-hook.
 * 
 * @param WC_Product $product Product instance.
 * @param            $values  
 * @param            $that    
 *
 * @return WC_Product
 */
function wp_kama_woocommerce_coupon_is_valid_for_product_filter( $product, $values, $that ){

	// filter...
	return $product;
}
$product(WC_Product)
Product instance.
$values
-
$that
-

Где вызывается хук

WC_Coupon::is_valid_for_product()
woocommerce_coupon_is_valid_for_product
woocommerce/includes/class-wc-coupon.php 893
return apply_filters( 'woocommerce_coupon_is_valid_for_product', false, $product, $this, $values );
woocommerce/includes/class-wc-coupon.php 930
return apply_filters( 'woocommerce_coupon_is_valid_for_product', $valid, $product, $this, $values );

Где используется хук в WooCommerce

Использование не найдено.