Store details about the original coupon

This commit is contained in:
Mike Jolley 2017-08-24 17:07:49 +01:00
parent b84efc1acd
commit 487478daa9
1 changed files with 3 additions and 2 deletions

View File

@ -494,8 +494,8 @@ class WC_Checkout {
/** /**
* Add coupon lines to the order. * Add coupon lines to the order.
* *
* @param WC_Order $order * @param WC_Order $order
* @param WC_Cart $cart * @param WC_Cart $cart
*/ */
public function create_order_coupon_lines( &$order, $cart ) { public function create_order_coupon_lines( &$order, $cart ) {
foreach ( $cart->get_coupons() as $code => $coupon ) { foreach ( $cart->get_coupons() as $code => $coupon ) {
@ -505,6 +505,7 @@ class WC_Checkout {
'discount' => $cart->get_coupon_discount_amount( $code ), 'discount' => $cart->get_coupon_discount_amount( $code ),
'discount_tax' => $cart->get_coupon_discount_tax_amount( $code ), 'discount_tax' => $cart->get_coupon_discount_tax_amount( $code ),
) ); ) );
$item->add_meta_data( 'coupon_data', $coupon->get_data() );
/** /**
* Action hook to adjust item before save. * Action hook to adjust item before save.