How to display drop down attribute on order page at back end? Tried editing the file grid.php.. it is diplaying the ID of a dropdown attribute but i want a value
1 Answer
In your Grid.php file, within the _prepareColumns()
method:
$options = array(
5 => 'Winter',
6 => 'Summer',
7 => 'Spring'
);
$this->addColumn('your_column',
array(
'header'=> $this->__('Seasons'),
'width' => '5%',
'index' => 'seasons',
'type' => 'options',
'options' => $options
)
);
-
-
Have you substituted your column name into the
your_index
section? (The column name in the table that you're using for this grid)– MooseCommented Feb 19, 2015 at 7:02 -
Here is what im using $this->addColumn('seasons', array( 'header' => Mage::helper('sales')->__('Seasons'), 'width' => '80', 'index' => 'seasons', 'type' => 'options', 'options' => $options ) ); $options = array( 5 => 'Winter', 6 => 'Summer', 7 => 'Spring', );– NadeemCommented Feb 19, 2015 at 7:04
-
Are you defining the options array prior to calling the
$this->addColumn
method?– MooseCommented Feb 19, 2015 at 7:16 -
Nopes.. im new to magento so can u please ellaborate abit :)– NadeemCommented Feb 19, 2015 at 7:19