From e7cbd23155357d44b5d8f3d2fff361f3736f4a30 Mon Sep 17 00:00:00 2001 From: David Remer Date: Wed, 2 Sep 2020 09:55:20 +0300 Subject: [PATCH] do not show dcc gateway on gateway edit screen --- modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php b/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php index 61417ff67..e05ed60c5 100644 --- a/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php +++ b/modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php @@ -158,12 +158,14 @@ class WcGatewayModule implements ModuleInterface { static function ( $methods ) use ( $container ): array { $methods[] = $container->get( 'wcgateway.paypal-gateway' ); $dcc_applies = $container->get( 'api.helpers.dccapplies' ); + + $screen = get_current_screen(); /** * The DCC Applies object. * * @var DccApplies $dcc_applies */ - if ( $dcc_applies->for_country_currency() ) { + if ( $screen->id !== 'woocommerce_page_wc-settings' && $dcc_applies->for_country_currency() ) { $methods[] = $container->get( 'wcgateway.credit-card-gateway' ); } return (array) $methods;