Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Payments::has_gateways()public staticWC 1.0

Check if the store has any enabled gateways.

{} Это метод класса: Payments{}

Хуков нет.

Возвращает

true|false.

Использование

$result = Payments::has_gateways();

Код Payments::has_gateways() WC 6.4.1

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 );
}