add coupon used order note at checkout
This commit is contained in:
parent
28f9c40700
commit
48d4c16353
|
@ -535,7 +535,13 @@ class WC_Checkout {
|
|||
wp_set_object_terms( $order_id, 'pending', 'shop_order_status' );
|
||||
|
||||
// Discount code meta
|
||||
if ($applied_coupons = $woocommerce->cart->get_applied_coupons()) update_post_meta($order_id, 'coupons', implode(', ', $applied_coupons));
|
||||
if ( $applied_coupons = $woocommerce->cart->get_applied_coupons() ) {
|
||||
|
||||
update_post_meta( $order_id, 'coupons', implode(', ', $applied_coupons) );
|
||||
|
||||
$order = new WC_Order( $order_id );
|
||||
$order->add_order_note( sprintf( __( 'Coupon Code Used: %s', 'woocommerce' ), implode(', ', $applied_coupons ) ) );
|
||||
}
|
||||
|
||||
// Order is saved
|
||||
do_action('woocommerce_checkout_order_processed', $order_id, $this->posted);
|
||||
|
|
Loading…
Reference in New Issue