1

I would like to know, how to add product attributes ie SKU, Color, Size at admin dashboard bestsellers tab?

app\code\core\Mage\Adminhtml\Block\Dashboard\Tab\Products\Ordered.php

Collection Code:

$collection = Mage::getResourceModel('sales/report_bestsellers_collection')
            ->setModel('catalog/product')
            ->addStoreFilter($storeId)
        ;

Tab screenshot from admin dashboard

1 Answer 1

0

Just Add ->join('catalog/product', 'product_id = entity_id', '*') to Collection Code.

$collection = Mage::getResourceModel('sales/report_bestsellers_collection')
            ->setModel('catalog/product')
            ->join('catalog/product', 'product_id = entity_id', '*')
            ->addStoreFilter($storeId);

Then create SKU Column.

$this->addColumn('sku', array(
            'header'    => Mage::helper('sales')->__('SKU'),
            'index'     => 'sku',
            'type'      => 'string',
            'sortable'  => false
        ));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.