Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

AdditionalPayments::can_view()publicWC 1.0

Task visibility.

{} It's a method of the class: AdditionalPayments{}

No Hooks.

Return

true|false.

Usage

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

Code of AdditionalPayments::can_view() WC 7.1.0

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;
	}
	if ( $this->get_parent_id() === 'extended_two_column' && WooCommercePayments::is_connected() ) {
		return false;
	}

	return true;
}