Introduce woocommerce_order_applied_coupon hook (#35616)
Co-authored-by: Néstor Soriano <konamiman@konamiman.com> Closes https://github.com/woocommerce/woocommerce/issues/34473
This commit is contained in:
parent
9fabda744a
commit
185d3337ca
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: add
|
||||||
|
|
||||||
|
Add the woocommerce_order_applied_coupon hook
|
|
@ -1211,6 +1211,16 @@ abstract class WC_Abstract_Order extends WC_Abstract_Legacy_Order {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action to signal that a coupon has been applied to an order.
|
||||||
|
*
|
||||||
|
* @param WC_Coupon $coupon The applied coupon object.
|
||||||
|
* @param WC_Order $order The current order object.
|
||||||
|
*
|
||||||
|
* @since 7.3
|
||||||
|
*/
|
||||||
|
do_action( 'woocommerce_order_applied_coupon', $coupon, $this );
|
||||||
|
|
||||||
$this->set_coupon_discount_amounts( $discounts );
|
$this->set_coupon_discount_amounts( $discounts );
|
||||||
$this->save();
|
$this->save();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue