I need to be able to add an SKU column to the Best Sellers report. I have managed to add the column to the page by adding:
$this->addColumn('sku', array(
'header' => Mage::helper('Sales')->__('Skus'),
'width' => '100px',
'index' => 'skus',
'type' => 'text',
));
to the _prepareColumns()
function but I cannot work out where I need to select the SKUs from in the Mage_Sales_Model_Resource_Report_Bestsellers
class.
Anyone have any ideas? Thanks in advance.
EDIT:
Added this join to _prepareColumns but still not getting any data:
$resourceCollection = Mage::getResourceModel($this->getResourceCollectionName());
$resourceCollection->join('catalog/product', 'product_id = entity_id', '*');
$resourceCollection->setPeriod($filterData->getData('period_type'));
$resourceCollection->setDateRange($filterData->getData('from', null), $filterData->getData('to', null));
$resourceCollection->addStoreFilter($storeIds);
$resourceCollection->setAggregatedColumns($this->_getAggregatedColumns());