Я знаю, что многие из вас посмотрят на это и скажут себе: какой идиот, но, надеюсь, кто-нибудь сможет указать мне правильное направление
Код: Выделить всё
add_filter( 'manage_woocommerce_page_wc-orders_columns', 'add_order_weight_column' );
function add_order_weight_column( $columns ) {
$columns['total_weight'] = __( 'Weight', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'populate_order_weight_column_content', 10, 2 );
function populate_order_weight_column_content( $column ) {
if ( $column == 'total_weight' ) {
global $the_order;
$total_weight = $the_order->get_meta('_cart_weight');
if ( $total_weight > 0 ) {
echo wc_format_weight( $total_weight );
} else {
_e('N/A', 'woocommerce');
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/786 ... compatible