diff --git a/modules/ppcp-wc-gateway/src/Admin/PaymentStatusOrderDetail.php b/modules/ppcp-wc-gateway/src/Admin/PaymentStatusOrderDetail.php index fceb8f523..f3eb33ba5 100644 --- a/modules/ppcp-wc-gateway/src/Admin/PaymentStatusOrderDetail.php +++ b/modules/ppcp-wc-gateway/src/Admin/PaymentStatusOrderDetail.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway\Admin; +use WC_Order; use WooCommerce\PayPalCommerce\WcGateway\Gateway\PayPalGateway; /** @@ -38,7 +39,10 @@ class PaymentStatusOrderDetail { * @param int $wc_order_id The WooCommerce order id. */ public function render( int $wc_order_id ) { - $wc_order = new \WC_Order( $wc_order_id ); + $wc_order = wc_get_order( $wc_order_id ); + if ( ! $wc_order instanceof WC_Order ) { + return; + } if ( ! $this->column->should_render_for_order( $wc_order ) || $this->column->is_captured( $wc_order ) ) { return;