Set payment method title for order edit page only if our gateway

This commit is contained in:
Alex P 2023-09-04 16:09:33 +03:00
parent fa60c3c8f5
commit f54f413f7b
No known key found for this signature in database
GPG key ID: 54487A734A204D71

View file

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