woocommerce_apply_individual_use_coupon хук-фильтр . WC 1.0
If its individual use then remove other coupons.
Использование
add_filter( 'woocommerce_apply_individual_use_coupon', 'filter_function_name_2068', 10, 3 ); function filter_function_name_2068( $array, $the_coupon, $applied_coupons ){ // filter... return $array; }
- $array
- -
- $the_coupon
- -
- $applied_coupons
- -
Где вызывается хук
woocommerce_apply_individual_use_coupon
woocommerce_apply_individual_use_coupon
woocommerce/includes/class-wc-cart.php 1715
$coupons_to_keep = apply_filters( 'woocommerce_apply_individual_use_coupon', array(), $the_coupon, $this->applied_coupons );
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 573
$coupons_to_remove = array_diff( $applied_coupons, apply_filters( 'woocommerce_apply_individual_use_coupon', array(), $coupon, $applied_coupons ) );