I want to add SKU new column at products bestsellers report in Magento 1.9.2.
Admin->reports->product->bestsellers report
I don't know how to add it.
Please suggest.
You need to override Mage_Adminhtml_Block_Report_Sales_Bestsellers_Grid Block which is responsible for the Grid data.
add something like follows after overriding :
$this->addColumn('product_sku', array(
'header' => Mage::helper('sales')->__('Product Sku'),
'index' => 'product_sku',
'type' => 'string',
'sortable' => false
));
It can be found at /public_html/app/code/core/Mage/Adminhtml/Block/Report/Sales/Bestsellers
after above is done, you can see a new column but without SKU data.
Now there are two ways of populating the sku data as follows:
First : Alter table sales_bestsellers_aggregated_daily and add a column named product_sku and then you need to extend the Model class to make sure that this field is filled just like product name.
Second : you need to create a renderer just like date is using in the above block file, trick here is to use product ID and fetch the SKU directly and show it in the grid.
Hope this helps