Merge pull request #578 from woocommerce/PCP-616-disabling-paypal-checkout-on-removes-buttons-from-cart

Unset the gateway only on checkout page
This commit is contained in:
Emili Castells 2022-05-17 10:44:27 +02:00 committed by GitHub
commit 125150ac58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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 ] );
}