Update: I successfully added the column and have customer’s notes on it. My code is as follow:
/* Add column "Order Notes" on orders page to display Customer's Notes */
add_filter('manage_edit-shop_order_columns', 'add_customer_note_column_header');
function add_customer_note_column_header($columns) {
$new_columns = (is_array($columns)) ? $columns : array();
$new_columns['order_customer_note'] = 'Order Notes';
return $new_columns;
}
/* End of adding "Order Notes" column */
add_action('admin_print_styles', 'add_customer_note_column_style');
function add_customer_note_column_style() {
$css = '.widefat .column-order_customer_note { width: 15%; }';
wp_add_inline_style('woocommerce_admin_styles', $css);
}
/* Add Customer's Notes to the "Order Notes" column */
add_action('manage_shop_order_posts_custom_column', 'add_customer_note_column_content');
function add_customer_note_column_content($column) {
global $post, $the_order;
if(empty($the_order) || $the_order->get_id() != $post->ID) {
$the_order = wc_get_order($post->ID);
}
$customer_note = $the_order->get_customer_note();
if($column == 'order_customer_note') {
echo('<span class="order-customer-note">' . $customer_note . '</span>');
}
}
However, I’d like to move it “forward” to between the “Status” and “Ship to” columns, and if possible have the same width as “Ship to”. How can I do this?
Plugin Support
slash1andy
(@slash1andy)
Automattic Happiness Engineer
Hey there!
I’d ask your question in the Advanced WooCommerce Group on Facebook (https://www.facebook.com/groups/advanced.woocommerce) to see if someone can help you out there, as they are more in the developer side of things.
We also highly recommend contacting one of the services on our Customizations page (https://woocommerce.com/customizations/)
Finally found what I was looking for!
A column that’s showing the customer notes without having to hover over it. Great work and thanks for sharing! 😀