Automattic\WooCommerce\Admin\Features\OnboardingTasks\Tasks

Products::has_products()public staticWC 1.0

Check if the store has any published products.

Method of the class: Products{}

No Hooks.

Return

true|false.

Usage

$result = Products::has_products();

Products::has_products() code WC 8.7.0

public static function has_products() {
	$counts = wp_count_posts('product');
	return isset( $counts->publish ) && $counts->publish > 0;
}