fix account change behavior

This commit is contained in:
Narek Zakarian 2022-09-05 15:38:14 +04:00
parent 8aa8b8de72
commit 4bc5254382
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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 );