WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\StoreApi\Utilities

ProductQuery::add_price_filter_clauses() protected WC 1.0

Add in conditional price filters.

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->add_price_filter_clauses( $args, $wp_query );
$args(массив) (обязательный)
Query args.
$wp_query(\WC_Query) (обязательный)
WC_Query object.

Код ProductQuery::add_price_filter_clauses() WC 4.7.1

<?php
protected function add_price_filter_clauses( $args, $wp_query ) {
	global $wpdb;

	$adjust_for_taxes = $this->adjust_price_filters_for_displayed_taxes();
	$args['join']     = $this->append_product_sorting_table_join( $args['join'] );

	if ( $wp_query->get( 'min_price' ) ) {
		$min_price_filter = $this->prepare_price_filter( $wp_query->get( 'min_price' ) );

		if ( $adjust_for_taxes ) {
			$args['where'] .= $this->get_price_filter_query_for_displayed_taxes( $min_price_filter, 'min_price', '>=' );
		} else {
			$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.min_price >= %f ', $min_price_filter );
		}
	}

	if ( $wp_query->get( 'max_price' ) ) {
		$max_price_filter = $this->prepare_price_filter( $wp_query->get( 'max_price' ) );

		if ( $adjust_for_taxes ) {
			$args['where'] .= $this->get_price_filter_query_for_displayed_taxes( $max_price_filter, 'max_price', '<=' );
		} else {
			$args['where'] .= $wpdb->prepare( ' AND wc_product_meta_lookup.max_price <= %f ', $max_price_filter );
		}
	}

	return $args;
}