Fix groupby for category segmentation in reports.
This commit is contained in:
parent
e63fb42fa1
commit
06deec11f8
|
@ -295,7 +295,7 @@ class WC_Admin_Reports_Coupons_Stats_Segmenting extends WC_Admin_Reports_Segment
|
||||||
RIGHT JOIN {$wpdb->prefix}term_taxonomy ON {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
|
RIGHT JOIN {$wpdb->prefix}term_taxonomy ON {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
|
||||||
";
|
";
|
||||||
$segmenting_where = " AND taxonomy = 'product_cat'";
|
$segmenting_where = " AND taxonomy = 'product_cat'";
|
||||||
$segmenting_groupby = 'wp_term_taxonomy.term_taxonomy_id';
|
$segmenting_groupby = 'wp_term_taxonomy.term_id';
|
||||||
$segmenting_dimension_name = 'category_id';
|
$segmenting_dimension_name = 'category_id';
|
||||||
|
|
||||||
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
|
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
|
||||||
|
|
|
@ -390,7 +390,7 @@ class WC_Admin_Reports_Orders_Stats_Segmenting extends WC_Admin_Reports_Segmenti
|
||||||
RIGHT JOIN {$wpdb->prefix}term_taxonomy ON {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
|
RIGHT JOIN {$wpdb->prefix}term_taxonomy ON {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
|
||||||
";
|
";
|
||||||
$segmenting_where = " AND taxonomy = 'product_cat'";
|
$segmenting_where = " AND taxonomy = 'product_cat'";
|
||||||
$segmenting_groupby = 'wp_term_taxonomy.term_taxonomy_id';
|
$segmenting_groupby = 'wp_term_taxonomy.term_id';
|
||||||
$segmenting_dimension_name = 'category_id';
|
$segmenting_dimension_name = 'category_id';
|
||||||
|
|
||||||
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
|
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
|
||||||
|
|
|
@ -179,7 +179,7 @@ class WC_Admin_Reports_Products_Stats_Segmenting extends WC_Admin_Reports_Segmen
|
||||||
RIGHT JOIN {$wpdb->prefix}term_taxonomy ON {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
|
RIGHT JOIN {$wpdb->prefix}term_taxonomy ON {$wpdb->prefix}term_relationships.term_taxonomy_id = {$wpdb->prefix}term_taxonomy.term_taxonomy_id
|
||||||
";
|
";
|
||||||
$segmenting_where = " AND taxonomy = 'product_cat'";
|
$segmenting_where = " AND taxonomy = 'product_cat'";
|
||||||
$segmenting_groupby = 'wp_term_taxonomy.term_taxonomy_id';
|
$segmenting_groupby = 'wp_term_taxonomy.term_id';
|
||||||
$segmenting_dimension_name = 'category_id';
|
$segmenting_dimension_name = 'category_id';
|
||||||
|
|
||||||
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
|
$segments = $this->get_product_related_segments( $type, $segmenting_selections, $segmenting_from, $segmenting_where, $segmenting_groupby, $segmenting_dimension_name, $table_name, $query_params, $unique_orders_table );
|
||||||
|
|
Loading…
Reference in New Issue