Magento Forum

   
How do I insert SKU column in report bestellers products? 
 
jurru
Jr. Member
 
Total Posts:  9
Joined:  2009-01-15
 

Answer:

Modify the following code from:
code\core\Mage\Adminhtml\Block\Report\Product\Ordered\Grid.php

$this->addColumn('price', array(
            
'header'    =>Mage::helper('reports')->__('Price'),
            
'width'     =>'120px',
            
'type'      =>'currency',
            
'currency_code' => $this->getCurrentCurrencyCode(),
            
'index'     =>'price'
        
));
        
        
$this->addColumn('ordered_qty', array(
            
'header'    =>Mage::helper('reports')->__('Quantity Ordered'),
            
'width'     =>'120px',
            
'align'     =>'right',
            
'index'     =>'ordered_qty',
            
'total'     =>'sum',
            
'type'      =>'number'
        
));

with:

$this->addColumn('price', array(
            
'header'    =>Mage::helper('reports')->__('Price'),
            
'width'     =>'120px',
            
'type'      =>'currency',
            
'currency_code' => $this->getCurrentCurrencyCode(),
            
'index'     =>'price'
        
));
        
$this->addColumn('sku', array(
             
'header'    =>Mage::helper('reports')->__('COD'),
            
'index'     =>'sku'
        
));

$this->addColumn('ordered_qty', array(
            
'header'    =>Mage::helper('reports')->__('Quantity Ordered'),
            
'width'     =>'120px',
            
'align'     =>'right',
            
'index'     =>'ordered_qty',
            
'total'     =>'sum',
            
'type'      =>'number'
        
));

 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

Your a genius!! It worked.. been trying to do this for 6 months!

Only question is, how do i get it to show the individual skus for each product color (see attachment)?

Thanks heaps mate!

Image Attachments
sku-custom-options.jpg
 
Magento Community Magento Community
Magento Community
Magento Community
 
justintime67
Sr. Member
 
Avatar
Total Posts:  188
Joined:  2009-08-12
 

I tried this but no good:

$this->addColumn(’price’, array(
‘header’ =>Mage::helper(’reports’)->__(’Price’),
‘width’ =>’120px’,
‘type’ =>’currency’,
‘currency_code’ => $this->getCurrentCurrencyCode(),
‘index’ =>’price’
));

$this->addColumn(’sku’, array(
‘header’ =>Mage::helper(’reports’)->__(’sku’),
‘index’ =>’sku’
‘index’ =>’product[sku]’
));

$this->addColumn(’ordered_qty’, array(
‘header’ =>Mage::helper(’reports’)->__(’Quantity Ordered’),
‘width’ =>’120px’,
‘align’ =>’right’,
‘index’ =>’ordered_qty’,
‘total’ =>’sum’,
‘type’ =>’number’
));

 
Magento Community Magento Community
Magento Community
Magento Community
 
rhaps
Jr. Member
 
Total Posts:  29
Joined:  2007-11-24
 

Any idea on how to solve that ?
Adding the column doesn’t display any value in rows.

 
Magento Community Magento Community
Magento Community
Magento Community
 
will_hough
Jr. Member
 
Avatar
Total Posts:  9
Joined:  2007-09-21
Michigan | USA
 

To add a sku column to Admin -> Reports -> Products -> Products Ordered

Open: \app\code\core\Mage\Adminhtml\Block\Report\Product\Sold\Grid.php

Find:

$this->addColumn('name', array(
            
'header'    =>Mage::helper('reports')->__('Product Name'),
            
'index'     =>'name'
        
));
Befor or after that block, depending upon where you want it. Add the following:
$this->addColumn('sku', array(
            
'header'    =>Mage::helper('reports')->__('sku'),
            
'index'     =>'sku'
        
));

 
Magento Community Magento Community
Magento Community
Magento Community
 
betterbatt
Member
 
Total Posts:  53
Joined:  2009-09-16
 
will_h - 29 August 2010 08:27 AM

To add a sku column to Admin -> Reports -> Products -> Products Ordered

Open: \app\code\core\Mage\Adminhtml\Block\Report\Product\Sold\Grid.php

Find:

$this->addColumn('name', array(
            
'header'    =>Mage::helper('reports')->__('Product Name'),
            
'index'     =>'name'
        
));
Befor or after that block, depending upon where you want it. Add the following:
$this->addColumn('sku', array(
            
'header'    =>Mage::helper('reports')->__('sku'),
            
'index'     =>'sku'
        
));

Thank you so much you are a life saver! Worked so perfectly. For anyone else who isn’t a programmer a good idea is to copy the file from :

/app/code/core/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php

and make this new directory structure for it:

/app/code/local/Mage/Adminhtml/Block/Report/Product/Sold/Grid.php

That way the core files aren’t touched.

Liam

 
Magento Community Magento Community
Magento Community
Magento Community
 
ddupit
Jr. Member
 
Total Posts:  17
Joined:  2010-06-14
miami
 

will_h

Thanks, this helped me out a lot!

 
Magento Community Magento Community
Magento Community
Magento Community
 
holger
Member
 
Total Posts:  39
Joined:  2007-08-31
Hannover, Germany
 

Hello, instead of the SKU for a Product, i want to display the Suffix of the Customer in the Customer Report.

in app/code/core/Mage/Adminhtml/Block/Report/Customer/Totals/Grid.php i added

$this->addColumn('suffix', array(
            
'header'    => $this->__('Suffix),
            '
sortable'  => false,
            '
index'     => 'suffix'
        ));

The header Output works well but nothing appears in the data fields below the header.
I have no clue how to solve it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
CoastAMS
Member
 
Avatar
Total Posts:  57
Joined:  2011-03-24
Bath
 

This seems to be on the same levels as what i’m after.

I need to add a column to a customer report that shows their last order date.

ANy ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
san01
Jr. Member
 
Total Posts:  3
Joined:  2012-06-23
 

Brilliant!
Thanks guys. I’ve been spent hours searching for this.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top