woocommerce_applied_coupon action-hookWC 2.6.0

Fires after a coupon has been applied to the cart.

Usage

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(string)
The coupon code that was applied.

Changelog

Since 2.6.0 Introduced.

Where the hook is called

CartController::apply_coupon()
woocommerce_applied_coupon
WC_Cart::apply_coupon()
woocommerce_applied_coupon
woocommerce/src/StoreApi/Utilities/CartController.php 1014
do_action( 'woocommerce_applied_coupon', $coupon_code );
woocommerce/includes/class-wc-cart.php 1811
do_action( 'woocommerce_applied_coupon', $coupon_code );

Where the hook is used in WooCommerce

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