Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

AdditionalPayments::can_view()publicWC 1.0

Task visibility.

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

Хуков нет.

Возвращает

true|false.

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

$AdditionalPayments = new AdditionalPayments();
$AdditionalPayments->can_view();

Код AdditionalPayments::can_view() WC 6.4.1

public function can_view() {
	if ( ! Features::is_enabled( 'payment-gateway-suggestions' ) ) {
		// Hide task if feature not enabled.
		return false;
	}

	$woocommerce_payments = new WooCommercePayments();

	if ( ! $woocommerce_payments->is_requested() || ! $woocommerce_payments->is_supported() || ! $woocommerce_payments->is_connected() ) {
		// Hide task if WC Pay is not installed via OBW, or is not connected, or the store is located in a country that is not supported by WC Pay.
		return false;
	}

	return true;
}