• is there a way to change the new order emails from woocommerce sent to me, to display price per item.
    its listed Product -> Qty -> total cost for qty of products

    Product -> Qty -> $ per each product individually -> total cost for qty of products

    thank you,
    Mike

Viewing 6 replies - 1 through 6 (of 6 total)
  • Hey man! I’m sure there are other options but i use this plugin and it is amazing!
    https://codecanyon.net/item/email-customizer-for-woocommerce/8654473

    Email notification of the order contains the same content and the email is sent to the webmail of the domain “qq.com”.

    What to do?

    Thread Starter MikeyPNJ

    (@mikeypnj)

    That plugin doesn’t specify if it will do what i need it to do.
    I am gonna add this image here for further reference of what I am trying to accomplish.

    https://www.discusmadness.com/wp-content/uploads/Capture2.png

    thank you,
    Mike

    Hi there, you mean product single price * qty, right?

    If that’s what you mean, maybe you can try this:

    <?php
    $item_total = $order->get_line_subtotal( $item );
    $qty = $item['qty'];
    $unit_price = $item_total/$qty;
    ?>
    <td class="td" style="text-align:left; vertical-align:middle; border: 1px solid #eee; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"><?php echo apply_filters( 'woocommerce_email_order_item_quantity', $unit_price . ' * ' . $item['qty'], $item ); ?></td>

    You can put the code at email-order-items.php

    • This reply was modified 7 years, 8 months ago by Ivan. Reason: additional information
    Thread Starter MikeyPNJ

    (@mikeypnj)

    it currenly gives me qty per item and total price for the total qty of that item.
    i would like to add price per (total for total qty of item divided by qty)

    so if someone ordered 5 of product XYZ and 2 of YYZ it only shows

    Product XYZ – QTY 5 – total $5
    Product YYZ – QTY 2 – total $50
    total $55

    i would like it to show

    Product XYZ – QTY 5 – $1 each – total $5
    Product YYZ – QTY 2 – $25 each – total $50
    total $55

    does that explain it better?

    thank you,
    Mike

    At email-order-details.php, look for this line:
    <th class="td" scope="col" style="text-align:left;"><?php _e( 'Qty', 'woocommerce' ); ?></th>
    then add this below it:
    <th class="td" scope="col" style="text-align:left;"><?php _e( 'Price', 'woocommerce' ); ?></th>
    if somehow the table structure broken, you can fix it by changing the table colspan in email-order-details.php at <tfoot>

    Then at email-order-items.php, look for this line:
    <td class="td" style="text-align:left; vertical-align:middle; border: 1px solid #eee; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"><?php echo apply_filters( 'woocommerce_email_order_item_quantity', $item['qty'], $item ); ?></td>

    right below it, you can add this:

    <?php
    $item_total = $order->get_line_subtotal( $item );
    $qty = $item['qty'];
    $unit_price = number_format($item_total/$qty, 2, ',', '.' );
    ?>
    <td class="td" style="text-align:left; vertical-align:middle; border: 1px solid #eee; font-family: 'Helvetica Neue', Helvetica, Roboto, Arial, sans-serif;"><?php echo get_woocommerce_currency_symbol() . ' ' . apply_filters( 'woocommerce_email_order_item_quantity', $unit_price . ' each', $item ); ?></td>

    The output will be more or less similar to your image link above.
    Output

    Hope this will help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WooCommerce New Order Emails’ is closed to new replies.