id, 'Alipay Trade No.', true ); $new_total_rows = array(); if( !empty($my_custom_field_1) ){ $new_row['alipay_trade_no'] = array( 'label' => __( 'Alipay Trade No.:', 'alipay' ), 'value' => $my_custom_field_1 ); // Insert $new_row after shipping field $total_rows = array_merge( array_splice( $total_rows,0,2), $new_row, $total_rows ); } return $total_rows; } add_filter( 'woocommerce_get_order_item_totals', 'wc_alipay_display_order_meta_for_customer', 10, 2 ); ?>