Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

WooCommercePayments::is_requested()public staticWC 1.0

Check if the plugin was requested during onboarding.

Method of the class: WooCommercePayments{}

No Hooks.

Return

true|false.

Usage

$result = WooCommercePayments::is_requested();

WooCommercePayments::is_requested() code WC 7.1.1

public static function is_requested() {
	$profiler_data       = get_option( OnboardingProfile::DATA_OPTION, array() );
	$product_types       = isset( $profiler_data['product_types'] ) ? $profiler_data['product_types'] : array();
	$business_extensions = isset( $profiler_data['business_extensions'] ) ? $profiler_data['business_extensions'] : array();

	$subscriptions_and_us = in_array( 'subscriptions', $product_types, true ) && 'US' === WC()->countries->get_base_country();
	return in_array( 'woocommerce-payments', $business_extensions, true ) || $subscriptions_and_us;
}