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

Filters if a coupon can be applied alongside other individual use coupons.

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

add_filter( 'woocommerce_apply_with_individual_use_coupon', 'wp_kama_woocommerce_apply_with_individual_use_coupon_filter', 10, 4 );

/**
 * Function for `woocommerce_apply_with_individual_use_coupon` filter-hook.
 * 
 * @param boolean    $apply_with_individual_use_coupon Defaults to false.
 * @param \WC_Coupon $coupon                           Coupon object applied to the cart.
 * @param \WC_Coupon $individual_use_coupon            Individual use coupon already applied to the cart.
 * @param array      $applied_coupons                  Array of applied coupons already applied to the cart.
 *
 * @return boolean
 */
function wp_kama_woocommerce_apply_with_individual_use_coupon_filter( $apply_with_individual_use_coupon, $coupon, $individual_use_coupon, $applied_coupons ){

	// filter...
	return $apply_with_individual_use_coupon;
}
$apply_with_individual_use_coupon(true|false)
Defaults to false.
$coupon(\WC_Coupon)
Coupon object applied to the cart.
$individual_use_coupon(\WC_Coupon)
Individual use coupon already applied to the cart.
$applied_coupons(массив)
Array of applied coupons already applied to the cart.

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

CartController::apply_coupon()
woocommerce_apply_with_individual_use_coupon
WC_Cart::apply_coupon()
woocommerce_apply_with_individual_use_coupon
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 973
if ( false === apply_filters( 'woocommerce_apply_with_individual_use_coupon', false, $coupon, $individual_use_coupon, $applied_coupons ) ) {
woocommerce/includes/class-wc-cart.php 1768
if ( $coupon->get_individual_use() && false === apply_filters( 'woocommerce_apply_with_individual_use_coupon', false, $the_coupon, $coupon, $this->applied_coupons ) ) {

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

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