diff --git a/plugins/woocommerce-admin/includes/class-wc-admin-reports-coupons-stats-segmenting.php b/plugins/woocommerce-admin/includes/class-wc-admin-reports-coupons-stats-segmenting.php index 42388b33541..43c1f2e6ee2 100644 --- a/plugins/woocommerce-admin/includes/class-wc-admin-reports-coupons-stats-segmenting.php +++ b/plugins/woocommerce-admin/includes/class-wc-admin-reports-coupons-stats-segmenting.php @@ -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 "; $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'; $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 ); diff --git a/plugins/woocommerce-admin/includes/class-wc-admin-reports-orders-stats-segmenting.php b/plugins/woocommerce-admin/includes/class-wc-admin-reports-orders-stats-segmenting.php index c61a0247851..b349dfad337 100644 --- a/plugins/woocommerce-admin/includes/class-wc-admin-reports-orders-stats-segmenting.php +++ b/plugins/woocommerce-admin/includes/class-wc-admin-reports-orders-stats-segmenting.php @@ -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 "; $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'; $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 ); diff --git a/plugins/woocommerce-admin/includes/class-wc-admin-reports-products-stats-segmenting.php b/plugins/woocommerce-admin/includes/class-wc-admin-reports-products-stats-segmenting.php index a1af0aa8285..e582d08dca2 100644 --- a/plugins/woocommerce-admin/includes/class-wc-admin-reports-products-stats-segmenting.php +++ b/plugins/woocommerce-admin/includes/class-wc-admin-reports-products-stats-segmenting.php @@ -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 "; $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'; $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 );