mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
Display funding source on the admin order page
Now the payment method title on the admin order editing page includes the funding source instead of just "PayPal" the same as in the order list.
This commit is contained in:
parent
74611528b5
commit
e70299e42b
1 changed files with 21 additions and 0 deletions
|
@ -271,6 +271,27 @@ class PayPalGateway extends \WC_Payment_Gateway {
|
|||
$this->order_endpoint = $order_endpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the gateway's title.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_title() {
|
||||
if ( is_admin() ) {
|
||||
// $theorder and other things for retrieving the order or post info are not available
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parent::get_title();
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the Gateway needs to be setup.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue