WordPress action hook
woocommerce_checkout_create_order_coupon_item
Defined by WooCommerce and fired by 5 plugins in total, running on 7M+ sites between them.
“Action hook to adjust item before save.”
How to use woocommerce_checkout_create_order_coupon_item
It's an action: your callback runs at that point and receives 4 arguments. Nothing needs to be returned.
Add this to your theme's functions.php or a small custom plugin:
add_action( 'woocommerce_checkout_create_order_coupon_item', function( $item, $code, $coupon, $order ) {
// Your code runs here.
}, 10, 4 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
5 plugins that fire woocommerce_checkout_create_order_coupon_item
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
do_action( 'woocommerce_checkout_create_order_coupon_item', $item, $code, $coupon, $order )includes/class-wc-checkout.php:786 -
Buckaroo Payments for WooCommerce2,000+ installs
do_action( 'woocommerce_checkout_create_order_coupon_item', $couponItem, $code, $coupon, $order )src/Gateways/Applepay/ApplepayGateway.php:369 -
우커머스 네이버페이200+ installs
do_action( 'woocommerce_checkout_create_order_coupon_item', $item, $code, $coupon, $order )includes/class-mnp-order.php:551 -
Briqpay for WooCommerce10+ installs
do_action( 'woocommerce_checkout_create_order_coupon_item', $item, $code, $coupon, $order )includes/class-checkout-handler.php:2139 -
Subscriptions & Recurring Payments for WooCommerce10+ installs
do_action( 'woocommerce_checkout_create_order_coupon_item', $coupon_item, $coupon_code, $coupon, $subscription )inc/classes/class-awc-subscription-switchers.php:945
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.