Shipping Method Column in the Orders List
Shows the chosen shipping method of each order in the admin orders list, so you can spot express and pickup orders before packing.
Opens WPIDE on
Code
$wpide_ship_column = function ( $columns ) {
$columns['wpide_shipping'] = 'Shipping';
return $columns;
};
$wpide_ship_render = function ( $column, $order ) {
if ( 'wpide_shipping' !== $column ) {
return;
}
$order = $order instanceof WC_Order ? $order : wc_get_order( $order );
if ( $order ) {
$method = $order->get_shipping_method();
echo esc_html( $method ? $method : '–' );
}
};
add_filter( 'manage_woocommerce_page_wc-orders_columns', $wpide_ship_column );
add_filter( 'manage_edit-shop_order_columns', $wpide_ship_column );
add_action( 'manage_woocommerce_page_wc-orders_custom_column', $wpide_ship_render, 10, 2 );
add_action( 'manage_shop_order_posts_custom_column', $wpide_ship_render, 10, 2 );
Notes
Orders with several shipping lines list them all, separated by commas.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.