Revert removal of gateway status check

Looks like it was accidentally removed after #704 merge conflict.
Without it we always render the hidden area for separate card gateway, so the check in JS fails and we always render all standard buttons separately in checkout, which may result in wrong style and other issues.
This commit is contained in:
Alex P 2022-08-05 17:12:51 +03:00
parent f256134148
commit 65b435135b

View file

@ -559,6 +559,12 @@ class SmartButton implements SmartButtonInterface {
return; 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, // The wrapper is needed for the loading spinner,
// otherwise jQuery block() prevents buttons rendering. // otherwise jQuery block() prevents buttons rendering.
echo '<div class="ppc-button-wrapper"><div id="ppc-button-' . esc_attr( $gateway_id ) . '"></div></div>'; echo '<div class="ppc-button-wrapper"><div id="ppc-button-' . esc_attr( $gateway_id ) . '"></div></div>';