Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::has_gatewayspublic staticWC 1.0

Check if the store has any enabled gateways.

Method of the class: Payments{}

No Hooks.

Returns

true|false.

Usage

$result = Payments::has_gateways();

Payments::has_gateways() code WC 10.6.2

public static function has_gateways() {
	$gateways         = WC()->payment_gateways()->payment_gateways;
	$enabled_gateways = array_filter(
		$gateways,
		function ( $gateway ) {
			return 'yes' === $gateway->enabled;
		}
	);

	return ! empty( $enabled_gateways );
}