display item price (not item total) in woocommerce emails

I need to display the item price in emails sent to admin and to customers using WooCommerce.
The default templates display Item, Quantity, and Price (item price X quantity). I can add the columns to the tables, but don’t know how to get the data from the product.
(It is interesting that this has not been included in the default. I dont think i’ve ever placed an order online that did not include the single item price.)

This post was helpful, but didn’t give me quite all needed:
display tax in woocommerce invoice

Related posts

Leave a Reply

3 comments

  1. It has been a while but this may come handy to someone else.

    As far as I am aware, there is no method that returns the unit price, but you can just calculate it by dividing the total price of the item by its quantity like so:

    $item->get_total() / $item->get_quantity()
    

    Since this will return just a number, you would probably want to add a currency symbol, so, you would end up with something like this:

    <?php echo wc_price($item->get_total() / $item->get_quantity()); ?>
    
  2. I edited plugins/woocommerce/templates/emails/email-order-items.php
    After product name I inserted the price:

     <br/>
       <strong><?php _e( 'Price', 'woocommerce' ); ?>:</strong>
    
       <?php echo apply_filters(    'woocommerce_cart_item_price', WC()->cart->get_product_price( $_product ), $cart_item, $cart_item_key ); ?>
    

    NB! I put my custom files in directory mytheme/woocommerce/emails/ – without “templates” folder (!). Strange but it’s the only way to force them working.

  3. Looks like @Anunja‘s code up above may no longer work – instead just add the following line underneath Product Name in a copied version of templates/emails/email-order-items.php

    echo '<br/>Individual Price $' . $_product->get_price();