woocommerce_applied_coupon хук-событиеWC 1.0

Fires after a coupon has been applied to the cart.

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

add_action( 'woocommerce_applied_coupon', 'wp_kama_woocommerce_applied_coupon_action' );

/**
 * Function for `woocommerce_applied_coupon` action-hook.
 * 
 * @param string $coupon_code The coupon code that was applied.
 *
 * @return void
 */
function wp_kama_woocommerce_applied_coupon_action( $coupon_code ){

	// action...
}
$coupon_code(строка)
The coupon code that was applied.

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

CartController::apply_coupon()
woocommerce_applied_coupon
WC_Cart::apply_coupon()
woocommerce_applied_coupon
woocommerce/includes/class-wc-cart.php 1794
do_action( 'woocommerce_applied_coupon', $coupon_code );

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

woocommerce/includes/class-wc-cart.php 107
add_action( 'woocommerce_applied_coupon', array( $this, 'calculate_totals' ), 20, 0 );