mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 18:16:38 +08:00
Use wc_get_order
to retrieve the order
This commit is contained in:
parent
ee3bff88bc
commit
ab02026816
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue