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

@ -165,8 +165,8 @@ class SmartButton implements SmartButtonInterface {
}
if (
$this->settings->has( 'dcc_gateway_enabled' )
&& $this->settings->get( 'dcc_gateway_enabled' )
$this->settings->has( 'dcc_enabled' )
&& $this->settings->get( 'dcc_enabled' )
&& ! $this->session_handler->order()
) {
add_action(
@ -772,7 +772,7 @@ class SmartButton implements SmartButtonInterface {
return false;
}
$keys = array(
'dcc_gateway_enabled' => 'is_checkout',
'dcc_enabled' => 'is_checkout',
);
foreach ( $keys as $key => $callback ) {
if ( $this->settings->has( $key ) && $this->settings->get( $key ) && $callback() ) {