Automattic\WooCommerce\Gateways\PayPal
Helper::is_paypal_gateway_available
Check if the PayPal gateway is enabled.
Method of the class: Helper{}
No Hooks.
Returns
true|false.
Usage
$result = Helper::is_paypal_gateway_available(): bool;
Helper::is_paypal_gateway_available() Helper::is paypal gateway available code WC 10.8.1
public static function is_paypal_gateway_available(): bool {
$settings = get_option( 'woocommerce_paypal_settings', array() );
$enabled = isset( $settings['enabled'] ) && 'yes' === $settings['enabled'];
$should_load = isset( $settings['_should_load'] ) && 'yes' === $settings['_should_load'];
return $enabled && $should_load;
}