Skip to content

Ordered Products Report not grouping by configurable products variations #25856

Closed
@lgrassini

Description

@lgrassini

Preconditions (*)

  1. Magento 2.3.3

Steps to reproduce (*)

  1. In the Magento 2 admin go to Reports -> Products -> Ordered
  2. Select a date range where you know you have sold products spanning across multiple orders
  3. Select 'Show By' Month
  4. Hit Refresh

Expected result (*)

The list of products grouped by SKU instead of product_id. So we can have information about number of products ordered for each product variation (ie: color).

Actual result (*)

Currently the report is grouping configurable porducts by product_id. Displaying the total of all of the variations (child products) into one product. The report, then, is not providing the total of each product variation like the example bellow:

incorrect-report

Propposed Fix

I fixed this in my local enviroment by replacing the GROUP BY clause from GROUP BY order_items.product_id to GROUP BY order_items.sku. on app/code/Magento/Reports/Model/ResourceModel/Product/Sold/Collection.php

fix

Metadata

Metadata

Assignees

Labels

Component: BackendComponent: ReportsFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentProgress: PR CreatedIndicates that Pull Request has been created to fix issueReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions