Check if PayPal Payments is available before renderering the buttons

This commit is contained in:
mattallan 2022-02-22 16:07:24 +10:00
parent c1cd718ecc
commit 28bed83598

View file

@ -442,6 +442,12 @@ class SmartButton implements SmartButtonInterface {
return;
}
$available_gateways = WC()->payment_gateways->get_available_payment_gateways();
if ( ! isset( $available_gateways['ppcp-gateway'] ) ) {
return;
}
echo '<div id="ppc-button"></div>';
}