Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 21st, 2012  |  syntax: None  |  size: 0.77 KB  |  hits: 19  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2.  
  3. $sizes = Mage::getModel('eav/entity_attribute_option')->getCollection()
  4.                     ->setStoreFilter()
  5.                     ->join('attribute','attribute.attribute_id=main_table.attribute_id', 'attribute_code');
  6.         foreach ($sizes as $item) {
  7.             if ($item->getAttributeCode() == 'size')
  8.                 $sizeOptions[$item->getOptionId()] = $item->getValue();
  9.         }
  10.         //echo '<pre>' . print_r($sizeOptions, true) . '</pre>';
  11.  
  12.         $this->addColumn('size', array(
  13.             'header'    => Mage::helper('reports')->__('Product Size'),
  14.             'sortable'  => false,
  15.             'index'     => 'size',
  16.             'width'     => '100px',
  17.             'type'      => 'options',
  18.             'options'   => $sizeOptions
  19.         ));