WooCommerce add order note to orderCompleted email
18:51 11 Apr 2016

I am at my wits end here and have tried every solution I could find online for days and nothing works. The worst part is the problem should be solvable in about 4 lines of code but it just isn't working.

What I need: When the order completed email goes out I want the order notes (not the customer notes, the actual Order Notes) added into the email. I can filter through them after but I cannot seem to get the notes to appear in the email at all. This is an example of an order note...on an order: order notes

so far I have tried this code:

::PHP::

get_customer_order_notes();
if($comments){
    echo '

' . _e( 'Order Notes', 'woocommerce' ) . '

'; foreach($comments as $comment) { echo $comment->comment_content . '
'; } } ?>

which is basically what I need except its targeting the customer_order_notes, which are comments users add into the order when they place it. like: "my dog will pick up my package, his name is lucky"

I have also written a lugin to get the notes based off other peoples, the base is this:

::PHP::

add_action( 'woocommerce_email_order_meta', 'bl_add_order_notes_to_completed_email', 10 );

function bl_add_order_notes_to_completed_email() {
    global $woocommerce, $post;
    // If the order is not completed then don't continue.
//    if ( get_post_status( $post->ID ) != 'wc-completed' ){
//        return false;
//    }

    $args = array(
        'post_id' => $post->ID,
        'status'  => 'approve',
        'type'    => 'order_note'
    );

    // Fetch comments
    $notes = get_comments( $args );

    echo '

' . _e( 'Order Notes', 'woocommerce' ) . '

'; echo '
    '; // Check that there are order notes if ( $notes ) { // Display each order note foreach( $notes as $note ) { ?>
  • comment_content ) ); ?>

    comment_date ) ), date_i18n( wc_time_format(), strtotime( $note->comment_date ) ) ); ?> comment_author !== __( 'WooCommerce', 'woocommerce-customer-order-notes-completed-order-emails' ) ) printf( ' ' . __( 'by %s', 'woocommerce-customer-order-notes-completed-order-emails' ), $note->comment_author ); ?>

  • '; }

I don't really know why that isnt working. It looks like it should but it does nothing.

If anyne has a solution that will print those notes into my email...like seen in this image...I will love you forever. enter image description here

php woocommerce