Automattic\WooCommerce\Blocks\BlockTypes\ProductCollection

QueryBuilder::get_on_sale_products_query()privateWC 1.0

Return a query for on sale products.

Метод класса: QueryBuilder{}

Хуков нет.

Возвращает

Массив.

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

// private - только в коде основоного (родительского) класса
$result = $this->get_on_sale_products_query( $is_on_sale );
$is_on_sale(true|false) (обязательный)
Whether to query for on sale products.

Код QueryBuilder::get_on_sale_products_query() WC 9.8.5

private function get_on_sale_products_query( $is_on_sale ) {
	if ( ! $is_on_sale ) {
		return array();
	}

	return array(
		'post__in' => wc_get_product_ids_on_sale(),
	);
}