diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index d7dd4c168..364189417 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -559,6 +559,12 @@ class SmartButton implements SmartButtonInterface { return; } + $available_gateways = WC()->payment_gateways->get_available_payment_gateways(); + + if ( ! isset( $available_gateways[ $gateway_id ] ) ) { + return; + } + // The wrapper is needed for the loading spinner, // otherwise jQuery block() prevents buttons rendering. echo '
';