WordPress
0
Вклад в тег
add_action( 'wp_enqueue_scripts', 'mini_enqueue_scripts' );
add_filter( 'manage_shop_order_posts_columns', 'woocommerce_add_order_notes_column', 99 );
function woocommerce_add_order_notes_column( $columns ) {
$columns['order_notes'] = __('Customer note', 'woocommerce');
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column' , 'woocommerce_show_order_notes_column', 10, 2 );
function woocommerce_show_order_notes_column( $column_name, $order_id ) {
switch ( $column_name ) {
case 'order_notes':
$order = wc_get_order( $order_id );
$note = $order->get_customer_note();
if ( !empty($note) ) {
echo '<span class="note-on tips" data-tip="' . wc_sanitize_tooltip( $note ) . '">' . __( 'Yes', 'woocommerce' ) . '</span>';
} else {
echo '<span class="na">–</span>';
}
break;
}
}