Search code examples
magentoproductconfigurable

Magento: "Products Ordered" report - how to show child products of configurable product?


When I create a "Products Ordered" report in Magento, configurable products show up as a single product, where the sales of all child products were summed up.

How can I modify this behaviour, so that - additionally - the child products are shown and their sold quantities?

The used version is Magento 1.6.2.


Solution

  • millejano from #magento-de helped me out and allowed me to post this answer:

    Create a rewrite for or copy /app/code/core/Mage/Reports/Model/Resource/Product/Collection.php to local.
    In addOrderedQty(), change the line

    ->where('parent_item_id IS NULL')
    

    to

    ->where('e.type_id = ?', 'simple')
    

    You're done. Instead of the summed up configurable product, you will now see the underlying simple products in every report and even on the dashboard.

    Original post by millejano: https://gist.github.com/3149637/