Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29904

WooCommerce - New Order email notification add Customer Notes

$
0
0

I'm trying to add Customer Notes (order_comments) to the New Order email in Woocommerce but to no avail. I've tried the code below in the function.php file but it didn't work. What am I doing wrong?

add_filter( 'woocommerce_email_order_meta_fields', 'custom_woocommerce_email_order_meta_fields', 10, 3 );

function custom_woocommerce_email_order_meta_fields( $fields, $sent_to_admin, $order ) {
    $fields['order_comments'] = array(
        'label' => __( 'Order Notes:' ),
        'value' => $order->get_meta( 'order_comments', true ),
    );
    return $fields;
}

Viewing all articles
Browse latest Browse all 29904

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>