Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Shipping::has_physical_products()public staticWC 1.0

Check if the store has physical products.

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

Хуков нет.

Возвращает

true|false.

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

$result = Shipping::has_physical_products();

Код Shipping::has_physical_products() WC 7.1.0

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

	return in_array( 'physical', $product_types, true );
}