How to Add Payment Type and Order Notes to All WooCommerce Emails

# This is post #5 of 31 in the challenge “Mastering WooCommerce

Today i will show you how to add payment method and order notes into completed order email for the purchase. Sometimes when the customer made the order, they would like to know which payment type chosen and the status of the order.

In order to show payment type and order notes, you can add code below into your theme functions.php:

add_action( 'woocommerce_email_after_order_table', 'custom_add_payment_type_to_emails', 15, 2 );
function custom_add_payment_type_to_emails( $order, $is_admin_email ) {
  args = array(
    'status' => 'approve',  
    'post_id' => $order->id
  $comments = get_comments($args);

  echo '<p><strong>Payment Type:</strong> ' . $order->payment_method_title . '</p>';
  echo '<p><strong>Order Notes:</strong> ';
  foreach($comments as $comment) :
    echo $comment->comment_content . '<br />';
  echo '</p>';

Leave a Comment.