Merge pull request #1661 from woocommerce/PCP-1965-method-title-order-editing

Set payment method title for order edit page only if our gateway
This commit is contained in:
Emili Castells 2023-09-05 12:36:29 +02:00 committed by GitHub
commit 8b21e50b25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -290,12 +290,14 @@ class PayPalGateway extends \WC_Payment_Gateway {
// in the constructor, so must do it here.
global $theorder;
if ( $theorder instanceof WC_Order ) {
if ( $theorder->get_payment_method() === self::ID ) {
$payment_method_title = $theorder->get_payment_method_title();
if ( $payment_method_title ) {
$this->title = $payment_method_title;
}
}
}
}
return parent::get_title();
}