Simple products report in Magento

by Igor Furseev

May 27, 2015 Comments (3)

Magento reports section is a powerful tool. If you open Reports > Products > Products Ordered section – you will be able to generate a report of all the recently sold products.
Sometimes, our clients, who mostly have the configurable and bundle products on the web store, ask the question: “Where can we find the exact number, for example, of clothes of each size sold? We see only T-shirt XXX sold number, without any size or colour”. Therefore, we had to find a solution to output the simple products in the report instead of the parents. Here we also describe the way to add another report page, which will allow us to see the sold simple products report in the admin panel. And the most important is that the native functionality is not changed and we do not use rewrites.

As always, we will start from the extension’s declaration with a dependency from Mage_Reports:

Furthermore, place a link to the report’s page to the admin menu: it can be achieved by the adminhtml.xml file which adds a menu item and ACL permissions declaration for it. Here we will also have to add a sort_order tag to the original menu items if we want to see our “Simple Products Ordered” right after “Products”. The original Mage_Reports extension’s adminhtml.xml does not have it:

We can simply change that line by copying magento_roo/app/code/core/Mage/Reports/Model/Resource/Product/Sold/Collection.php to a local pool and adding addOrderedQty method to it. But we will replace the core functionality in that way.

So, to give a brief statement of the main points – as you can see, creating extensions like this is pretty simple and teaches us how to code without overrides. In addition, the same approach can be used for other report pages in the “Products” section: Low Stock, Best Sellers, Views.

We will be glad to see your feedback or any additional questions in the comments below.

Share

Subscribe to our blog

Your email

Interestedin Atwix?

Smart Brands Choose Us.

From Mark Cuban and Sir Richard Branson backed startups, to Inc 500 US Fastest Growing Companies and Global Brands choose us to deliver and support unparalleled eСommerce experience for their customers.