diff --git a/modules/ppcp-settings/src/SettingsModule.php b/modules/ppcp-settings/src/SettingsModule.php index 19e293965..c1f72cf48 100644 --- a/modules/ppcp-settings/src/SettingsModule.php +++ b/modules/ppcp-settings/src/SettingsModule.php @@ -394,6 +394,23 @@ class SettingsModule implements ServiceModule, ExecutableModule { 2 ); + add_filter( + 'woocommerce_paypal_payments_credit_card_gateway_title', + function( string $title, WC_Payment_Gateway $gateway ) { + return $gateway->get_option( 'title', $title ); + }, + 10, + 2 + ); + add_filter( + 'woocommerce_paypal_payments_credit_card_gateway_description', + function( string $description, WC_Payment_Gateway $gateway ) { + return $gateway->get_option( 'description', $description ); + }, + 10, + 2 + ); + return true; } diff --git a/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php b/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php index 7a41a40ef..90457ad77 100644 --- a/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php +++ b/modules/ppcp-wc-gateway/src/Gateway/CreditCardGateway.php @@ -278,8 +278,9 @@ class CreditCardGateway extends \WC_Payment_Gateway_CC { 'Accept debit and credit cards, and local payment methods with PayPal’s latest solution.', 'woocommerce-paypal-payments' ); - $this->title = $this->dcc_configuration->gateway_title(); - $this->description = $this->dcc_configuration->gateway_description(); + + $this->title = apply_filters( 'woocommerce_paypal_payments_credit_card_gateway_title', $this->dcc_configuration->gateway_title(), $this ); + $this->description = apply_filters( 'woocommerce_paypal_payments_credit_card_gateway_description', $this->dcc_configuration->gateway_description(), $this ); $this->card_icons = $card_icons; $this->init_form_fields();