diff --git a/modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php b/modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php index c84006a0b..10b49ea5e 100644 --- a/modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php +++ b/modules/ppcp-wc-gateway/src/Helper/DCCProductStatus.php @@ -62,6 +62,7 @@ class DCCProductStatus { if ( is_bool( $this->current_status_cache ) ) { return $this->current_status_cache; } + //var_dump($this->settings->has( 'products_dcc_enabled' ) && $this->settings->get( 'products_dcc_enabled' ));die; if ( $this->settings->has( 'products_dcc_enabled' ) && $this->settings->get( 'products_dcc_enabled' ) ) { $this->current_status_cache = true; return true; diff --git a/modules/ppcp-wc-gateway/src/Settings/SettingsListener.php b/modules/ppcp-wc-gateway/src/Settings/SettingsListener.php index 307f6c261..d9c184e7f 100644 --- a/modules/ppcp-wc-gateway/src/Settings/SettingsListener.php +++ b/modules/ppcp-wc-gateway/src/Settings/SettingsListener.php @@ -259,7 +259,7 @@ class SettingsListener { $credentials_change_status = null; // Cannot detect on Card Processing page. - if ( PayPalGateway::ID === $this->page_id ) { + if ( PayPalGateway::ID === $this->page_id || Settings::CONNECTION_TAB_ID === $this->page_id ) { $settings['enabled'] = isset( $_POST['woocommerce_ppcp-gateway_enabled'] ) && 1 === absint( $_POST['woocommerce_ppcp-gateway_enabled'] ); @@ -267,7 +267,6 @@ class SettingsListener { } // phpcs:enable phpcs:disable WordPress.Security.NonceVerification.Missing // phpcs:enable phpcs:disable WordPress.Security.NonceVerification.Missing - if ( $credentials_change_status ) { if ( self::CREDENTIALS_UNCHANGED !== $credentials_change_status ) { $this->settings->set( 'products_dcc_enabled', null );