WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\Notes

FilterByProductVariationsInReports::are_products_with_variations() private WC 1.0

Returns whether or not there are variable products.

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

No Hooks.

Return

true|false. If there are variable products

Usage

$result = FilterByProductVariationsInReports::are_products_with_variations();

Code of FilterByProductVariationsInReports::are_products_with_variations() WC 5.2.2

<?php
private static function are_products_with_variations() {
	$query    = new \WC_Product_Query(
		array(
			'limit'    => 1,
			'paginate' => true,
			'return'   => 'ids',
			'status'   => array( 'publish' ),
			'type'     => array( 'variable' ),
		)
	);
	$products = $query->get_products();
	$count    = $products->total;

	return 0 !== $count;
}