WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Displaying Coupon Code in New Order Email (2 posts)

  1. eurekaadminguy
    Member
    Posted 9 months ago #

    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:

    admin-new-order.php

    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

    http://wordpress.org/plugins/woocommerce/

  2. shturmie
    Member
    Posted 8 months ago #

    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;'; ?>">

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

    </th>

Reply

You must log in to post.

About this Plugin

About this Topic