woocommerce_order_recalculate_coupons_coupon_object хук-фильтрWC 3.2.0

Allow developers to filter this coupon before it gets re-applied to the order.

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

add_filter( 'woocommerce_order_recalculate_coupons_coupon_object', 'wp_kama_woocommerce_order_recalculate_coupons_coupon_object_filter', 10, 4 );

/**
 * Function for `woocommerce_order_recalculate_coupons_coupon_object` filter-hook.
 * 
 * @param  $coupon_object 
 * @param  $coupon_code   
 * @param  $coupon_item   
 * @param  $that          
 *
 * @return 
 */
function wp_kama_woocommerce_order_recalculate_coupons_coupon_object_filter( $coupon_object, $coupon_code, $coupon_item, $that ){

	// filter...
	return $coupon_object;
}
$coupon_object
-
$coupon_code
-
$coupon_item
-
$that
-

Список изменений

С версии 3.2.0 Введена.

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

WC_Abstract_Order::recalculate_coupons()
woocommerce_order_recalculate_coupons_coupon_object
woocommerce/includes/abstracts/abstract-wc-order.php 1316
$coupon_object = apply_filters( 'woocommerce_order_recalculate_coupons_coupon_object', $coupon_object, $coupon_code, $coupon_item, $this );

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

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