do not show dcc gateway on gateway edit screen

This commit is contained in:
David Remer 2020-09-02 09:55:20 +03:00
parent 44c2acb0f6
commit e7cbd23155

View file

@ -158,12 +158,14 @@ class WcGatewayModule implements ModuleInterface {
static function ( $methods ) use ( $container ): array { static function ( $methods ) use ( $container ): array {
$methods[] = $container->get( 'wcgateway.paypal-gateway' ); $methods[] = $container->get( 'wcgateway.paypal-gateway' );
$dcc_applies = $container->get( 'api.helpers.dccapplies' ); $dcc_applies = $container->get( 'api.helpers.dccapplies' );
$screen = get_current_screen();
/** /**
* The DCC Applies object. * The DCC Applies object.
* *
* @var DccApplies $dcc_applies * @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' ); $methods[] = $container->get( 'wcgateway.credit-card-gateway' );
} }
return (array) $methods; return (array) $methods;