Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

AdditionalPayments::has_gateways()public staticWC 1.0

Check if the store has any enabled gateways.

Method of the class: AdditionalPayments{}

No Hooks.

Return

true|false.

Usage

$result = AdditionalPayments::has_gateways();

AdditionalPayments::has_gateways() code WC 7.1.0

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

	return ! empty( $enabled_gateways );
}