2

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 1

1

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
    )
);
9
  • Nothing changed, besides its not even displaying the ID
    – Nadeem
    Commented Feb 19, 2015 at 7:00
  • Have you substituted your column name into the your_index section? (The column name in the table that you're using for this grid)
    – Moose
    Commented 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', );
    – Nadeem
    Commented Feb 19, 2015 at 7:04
  • Are you defining the options array prior to calling the $this->addColumn method?
    – Moose
    Commented Feb 19, 2015 at 7:16
  • Nopes.. im new to magento so can u please ellaborate abit :)
    – Nadeem
    Commented Feb 19, 2015 at 7:19

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.