I found that Magento Reports module is very tricky and confusing to debug.
Though I got that the Reports > Product > Products Ordered
collection is generated from Mage/Adminhtml/controllers/Report/ProductController.php
soldAction
, I cannot seem to get query or data for debugging purposes when I change it's Grid's (Mage_Adminhtml_Block_Report_Product_Sold_Grid) _prepareCollection
to below.
protected function _prepareCollection()
{
parent::_prepareCollection();
$debugCollection = $this->getCollection()->initReport('reports/product_sold_collection');
$size = $debugCollection->getSize();
$debug = $debugCollection->debug();
//or
$debugQuery = $debugCollection->getSelect();
//or
$debugData = $debugCollection->getData();
$this->getCollection()->initReport('reports/product_sold_collection');
return $this;
}
All functions getData()
, debug()
& getSelect()
seem to be undefined in that module class hierarchy.