Unset the gateway only on checkout page

This commit is contained in:
Narek Zakarian 2022-04-11 18:29:30 +04:00
parent 8a7a64cb7e
commit b0ad59e92f

View file

@ -69,7 +69,7 @@ class DisableGateways {
unset( $methods[ CreditCardGateway::ID ] );
}
if ( $this->settings->has( 'button_enabled' ) && ! $this->settings->get( 'button_enabled' ) && ! $this->session_handler->order() ) {
if ( $this->settings->has( 'button_enabled' ) && ! $this->settings->get( 'button_enabled' ) && ! $this->session_handler->order() && is_checkout() ) {
unset( $methods[ PayPalGateway::ID ] );
}