Show order notes

Order notes are not shown on the order list by default (customer notes, which are entered by the customer in the checkout are), but they can easily be added.

Place the following code in your themes functions.php or a plugin like Code Snippets (read this if you haven’t used filters like this before and don’t know what to do with this):

add_action( 'wpo_wcol_custom_row', 'wpo_wcol_customer_notes', 10, 1 );
function wpo_wcol_customer_notes ( $order_id ) {
	$args = array(
		'post_id' 	=> $order_id,
		'approve' 	=> 'approve',
		'type' 		=> 'order_note'
	);

	remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

	$notes = get_comments( $args );

	add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

	if ( $notes ) {
		foreach( $notes as $key => $note ) {
			// only display customer notes
			if ( get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) {
				printf( '<div class="note_content">%s</div>', wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ) );
			}
		}
	}
}

Alternatively, if you want to have more control over how the customer notes are output, you can create a custom template by copying the order list templates to your (child) theme. Instructions on how to do this are on the bottom of the settings page, or more detailed instruction on this page: Creating a custom template.

After you have created the custom template, insert the following code (which is basically the content of the function above!).

<?php
$args = array(
	'post_id' 	=> $order_id,
	'approve' 	=> 'approve',
	'type' 		=> 'order_note'
);

remove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

$notes = get_comments( $args );

add_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );

if ( $notes ) {
	foreach( $notes as $key => $note ) {
		// only display customer notes
		if ( get_comment_meta( $note->comment_ID, 'is_customer_note', true ) ) {
			printf( '<div class="note_content">%s</div>', wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ) );
		}
	}
}
?>