magento / magento2

Prior to making any Submission(s), you must sign an Adobe Contributor License Agreement, available here at: https://opensource.adobe.com/cla.html. All Submissions you make to Adobe Inc. and its affiliates, assigns and subsidiaries (collectively “Adobe”) are subject to the terms of the Adobe Contributor License Agreement.
http://www.magento.com
Open Software License 3.0
11.55k stars 9.32k forks source link

Best seller report does not include configurable products #35245

Open ioweb-gr opened 2 years ago

ioweb-gr commented 2 years ago

Preconditions (*)

  1. 2.4.3-p1

Steps to reproduce (*)

  1. Try to order a few configurable items in Magento 2
  2. Refresh statistics for the best seller report
  3. Execute this query in the database
    
    select *
    from catalog_product_entity product
         left join sales_bestsellers_aggregated_daily
                   on product.entity_id = sales_bestsellers_aggregated_daily.product_id
    where product.type_id = 'configurable' and sales_bestsellers_aggregated_daily.id is not null;

You will notice no configurables are being added in the best seller table. 
While this may be desirable as only real products are being sold (in this case the variations), it actually causes issues in presenting the best sellers on the frontend. Normally for configurable products the variations are set to "Not Visible Individually". When trying to load the best sellers collection you will notice that only the children are loaded which are not visible. 

In an e-shop selling only shoes for example, all the products that are visible in the catalog will be configurable. Thus, it's impossible to use the best sellers report to present those configurable products in the frontend. 

### Expected result (*)
<!--- Tell us what do you expect to happen. -->
1. The best seller report tables should also list the configurable products 

### Actual result (*)
<!--- Tell us what happened instead. Include error messages and issues. -->
1. The best seller report tables are always listing only simple products

---
Please provide [Severity](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#backlog) assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

- [ ] Severity: **S0** _- Affects critical data or functionality and leaves users without workaround._
- [ ] Severity: **S1** _- Affects critical data or functionality and forces users to employ a workaround._
- [X] Severity: **S2** _- Affects non-critical data or functionality and forces users to employ a workaround._
- [ ] Severity: **S3** _- Affects non-critical data or functionality and does not force users to employ a workaround._
- [ ] Severity: **S4** _- Affects aesthetics, professional look and feel, “quality” or “usability”._
m2-assistant[bot] commented 2 years ago

Hi @ioweb-gr. Thank you for your report. To speed up processing of this issue, make sure that you provided the following information:

Make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, Add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, review the Magento Contributor Assistant documentation.

Add a comment to assign the issue: @magento I am working on this

To learn more about issue processing workflow, refer to the Code Contributions.


:clock10: You can find the schedule on the Magento Community Calendar page.

:telephone_receiver: The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, join the Community Contributions Triage session to discuss the appropriate ticket.

:pencil2: Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

m2-assistant[bot] commented 2 years ago

Hi @engcom-November. Thank you for working on this issue. In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

engcom-November commented 2 years ago

Hi @ioweb-gr , Thank you for reporting and collaboration. Verified this on Magento 2.4-develop branch Bestsellers Report includes the product name, price, and quantity ordered in both UI and DB table. Since configurable products can be ordered with simple product configurations only and cant be ordered alone, simple products are displayed in both UI and DB . Please refer the magento docs for the same. Adding Configurable product can be considered as feature request but not bug. Please provide your inputs on this. image

image Thank you.

ioweb-gr commented 2 years ago

From a technical scope I would agree this is a missing functionality that should be added.

From a user's point of view though, this is something that's not working correctly.

The user expects to see which products he sold most.

My customer's complaint was I'm trying to list my best selling products but no products appear . He doesn't understand the technical reason behind it, although I could view this was the reason behind the scenes. From his point of view it's a bug.

If the user wants to display the best sellers, then currently he's unable to do so, when his e-shop is full of configurable products.

Moreover the list is also not accurate, because let's say from one dress I keep selling only the black color and I've sold 10 items of it.

From another dress I've sold 9 black dresses, 9 purple, 9 red. Which of the two products is the true best seller and more likely to purchase again? Obviously the second one with the most total sales.

engcom-November commented 2 years ago

Hi @ioweb-gr , Thank you for your inputs. Considering this as feature request since this((Configurable products alone are not displayed in best sellers list).) is an existing default behavior of Magento. There are some 3rd party extensions available which may serve your purpose for now. Considering this an enhancement and adding Feature request label. Ex: https://www.proxiblue.com.au/premium-modules/magento-dynamic-category-products.html https://github.com/seansan/SNH_Bestseller