Skip to content

Instantly share code, notes, and snippets.

View lukasprelovsky's full-sized avatar

Lukáš Prelovský lukasprelovsky

View GitHub Profile
@popforce
popforce / functions.php
Last active December 17, 2019 12:56 — forked from kloon/functions.php
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;