Segmenter::get_segment_selections_order_level()protectedWC 1.0

Returns column => query mapping to be used for order-related product-level segmenting query (e.g. orders_count when segmented by category).

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

Хуков нет.


Массив. Column => SELECT query mapping.


// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_segment_selections_order_level( $coupons_lookup_table );
$coupons_lookup_table(строка) (обязательный)
Name of SQL table containing the order-level segmenting info.

Код Segmenter::get_segment_selections_order_level() WC 7.3.0

protected function get_segment_selections_order_level( $coupons_lookup_table ) {
	$columns_mapping = array(
		'coupons_count' => "COUNT(DISTINCT $coupons_lookup_table.coupon_id) as coupons_count",
		'orders_count'  => "COUNT(DISTINCT $coupons_lookup_table.order_id) as orders_count",

	return $columns_mapping;