WordPress at a glance
function is not described


Segmenter::get_product_related_segments() protected WC 1.0

Calculate segments for segmenting property bound to product (e.g. category, product_id, variation_id).

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

No Hooks.


Array. Nothing.


// protected - for code of main (parent) or child class
$result = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
$type(string) (required)
Type of segments to return--'totals' or 'intervals'.
$segmenting_selections(array) (required)
SELECT part of segmenting SQL query--one for 'product_level' and one for 'order_level'.
$segmenting_from(string) (required)
FROM part of segmenting SQL query.
$segmenting_where(string) (required)
WHERE part of segmenting SQL query.
$segmenting_groupby(string) (required)
GROUP BY part of segmenting SQL query.
$segmenting_dimension_name(string) (required)
Name of the segmenting dimension.
$table_name(string) (required)
Name of SQL table which is the stats table for orders.
$query_params(array) (required)
Array of SQL clauses for intervals/totals query.
$unique_orders_table(string) (required)
Name of temporary SQL table that holds unique orders.

Code of Segmenter::get_product_related_segments() WC 5.3.0

protected function get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table ) {
	if ( 'totals' === $type ) {
		return $this->get_product_related_totals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
	} elseif ( 'intervals' === $type ) {
		return $this->get_product_related_intervals_segments( $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );