diff --git a/includes/admin/list-tables/class-wc-admin-list-table-orders.php b/includes/admin/list-tables/class-wc-admin-list-table-orders.php index 5df88588cfd..7da833e20ba 100644 --- a/includes/admin/list-tables/class-wc-admin-list-table-orders.php +++ b/includes/admin/list-tables/class-wc-admin-list-table-orders.php @@ -548,6 +548,18 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { if ( ! $order ) { return array(); } + + $payment_via = $order->get_payment_method_title(); + $payment_gateways = WC()->payment_gateways() ? WC()->payment_gateways->payment_gateways() : array(); + + if ( $transaction_id = $order->get_transaction_id() ) { + if ( isset( $$payment_gateways[ $payment_method ] ) && ( $url = $payment_gateways[ $payment_method ]->get_transaction_url( $order ) ) ) { + $payment_via .= ' (' . esc_html( $transaction_id ) . ')'; + } else { + $payment_via .= ' (' . esc_html( $transaction_id ) . ')'; + } + } + return apply_filters( 'woocommerce_admin_order_preview_get_order_details', array( 'data' => $order->get_data(), 'order_number' => $order->get_order_number(), @@ -558,7 +570,7 @@ class WC_Admin_List_Table_Orders extends WC_Admin_List_Table { 'formatted_billing_address' => ( $address = $order->get_formatted_billing_address() ) ? $address : __( 'N/A', 'woocommerce' ), 'formatted_shipping_address' => ( $address = $order->get_formatted_shipping_address() ) ? $address: __( 'N/A', 'woocommerce' ), 'shipping_address_map_url' => $order->get_shipping_address_map_url(), - 'payment_via' => $order->get_payment_method_title() . ( $order->get_transaction_id() ? ' (' . $order->get_transaction_id() . ')' : '' ), + 'payment_via' => $payment_via, 'shipping_via' => $order->get_shipping_method(), ), $order ); }