Instantly share code, notes, and snippets.

@grola /functions.php
Last active Feb 28, 2018

Embed
What would you like to do?
Add customer note to all admin emails
<?php
add_action( 'woocommerce_email_after_order_table', 'studiowp_woocommerce_email_after_order_table_customer_note', 10, 4 );
function studiowp_woocommerce_email_after_order_table_customer_note( $order, $sent_to_admin, $plain_text, $email ) {
if ( $sent_to_admin ) {
if ( $order->get_customer_note() != '' ) {
echo sprintf( '<h2>%s</h2>', __( 'Customer note', 'woocommerce' ) );
echo sprintf( '<p><strong>%s</strong></p>', $order->get_customer_note() );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment