Segmenter::get_segment_selections_product_level()protectedWC 1.0

Returns column => query mapping to be used for product-related product-level segmenting query (e.g. coupon discount amount for product X when segmenting by product id or category).

Method of the class: Segmenter{}

No Hooks.


Array. Column => SELECT query mapping.


// protected - for code of main (parent) or child class
$result = $this->get_segment_selections_product_level( $products_table );
$products_table(string) (required)
Name of SQL table containing the product-level segmenting info.

Segmenter::get_segment_selections_product_level() code WC 7.3.0

protected function get_segment_selections_product_level( $products_table ) {
	$columns_mapping = array(
		'amount' => "SUM($products_table.coupon_amount) as amount",

	return $columns_mapping;