Add tracking information to orders history
For mode “Run at frontend”.
Before using this code – you must install and activate https://woocommerce.com/products/shipment-tracking/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
add_filter( 'wpo_order_history_customer_table_headers', function($headers) { $new_headers = array(); foreach($headers as $header) { $new_headers[] = $header; if ( $header['key'] == 'status') $new_headers[] = array( 'key'=>'shipment_tracking', 'label'=>'Shipment Tracking', 'escape'=>false); } return $new_headers ; }); add_filter('wpo_order_history_customer_table_row', function($data,$order) { if( class_exists('WC_Shipment_Tracking_Actions') ) $data['shipment_tracking'] = WC_Shipment_Tracking_Actions::get_instance()- >get_shipment_tracking_column( $order->get_id() ); return $data; },10,2); |