Skip to content

Instantly share code, notes, and snippets.

View famousmrthomas's full-sized avatar

FamousMrThomas famousmrthomas

View GitHub Profile
@kloon
kloon / functions.php
Last active March 4, 2024 19:36
WooCommerce total order weight column on orders page
<?php
add_filter( 'manage_edit-shop_order_columns', 'woo_order_weight_column' );
function woo_order_weight_column( $columns ) {
$columns['total_weight'] = __( 'Weight', 'woocommerce' );
return $columns;
}
add_action( 'manage_shop_order_posts_custom_column', 'woo_custom_order_weight_column', 2 );
function woo_custom_order_weight_column( $column ) {
global $post, $woocommerce, $the_order;