Support » Plugin: WooCommerce » Displaying Coupon Code in New Order Email

  • eurekaadminguy


    Can someone help me with a change. I want to put the coupon code (if one is used) for an order in the “new order” email that is sent to admin when an order is placed.

    I know the change would need to go in this file:


    But that’s about as much as I am able to figure out as I am not a php code wiz. I can do a great job of cut and paste, just need to know the code needed to do this, I’ll take care of the rest.

    Thanks, Mike

Viewing 1 replies (of 1 total)
  • Hi Mike,

    I just had to do the same thing and here the snippet of code i switched to on admin-new-order.php at line 38:

    <th scope=”row” colspan=”2″ style=”text-align:left; border: 1px solid #eee; <?php if ( $i == 1 ) echo ‘border-top-width: 4px;’; ?>”>

    if ($total[‘label’] ==’Cart Discount’) {
    echo ‘VIP/Trainer Code ‘;
    $couponR = $order->get_used_coupons( );
    foreach ($couponR as $singleCoupon) {
    echo $singleCoupon.’
    else {
    echo $total[‘label’];


Viewing 1 replies (of 1 total)
  • The topic ‘Displaying Coupon Code in New Order Email’ is closed to new replies.