add setting and manage availability of dcc gateway

This commit is contained in:
David Remer 2020-09-02 13:52:40 +03:00
parent f9e64abe14
commit 57a6f8b85c
7 changed files with 22 additions and 10 deletions

View file

@ -60,7 +60,7 @@ return array(
}
$settings = $container->get( 'wcgateway.settings' );
$paypal_disabled = ! $settings->has( 'enabled' ) || ! $settings->get( 'enabled' );
$credit_card_disabled = ! $settings->has( 'dcc_gateway_enabled' ) || ! $settings->get( 'dcc_gateway_enabled' );
$credit_card_disabled = ! $settings->has( 'dcc_enabled' ) || ! $settings->get( 'dcc_enabled' );
if ( $paypal_disabled && $credit_card_disabled ) {
return new DisabledSmartButton();
}