Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Shipping::is_selling_digital_type_only()private staticWC 1.0

Check if the store sells digital products only.

Method of the class: Shipping{}

No Hooks.

Return

true|false.

Usage

$result = Shipping::is_selling_digital_type_only();

Shipping::is_selling_digital_type_only() code WC 7.1.0

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

	return array( 'downloads' ) === $product_types;
}