In my user module, I created a grid that loads all products. I have already added the following columns:
$this->addColumn('entity_id', array( 'header' => Mage::helper('customer')->__('ID'), 'width' => '50px', 'index' => 'entity_id', 'type' => 'number', )); $this->addColumn('name', array( 'header' => Mage::helper('customer')->__('Name'), 'index' => 'name' )); $this->addColumn('price', array( 'header' => Mage::helper('catalog')->__('Price'), 'type' => 'currency', 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE), 'index' => 'price' )); $this->addColumn('sku', array( 'header' => Mage::helper('catalog')->__('SKU'), 'width' => '90', 'index' => 'sku', )); $this->addColumn('status', array( 'header' => Mage::helper('catalog')->__('Status'), 'align' => 'left', 'width' => '80px', 'index' => 'status', 'type' => 'options', 'options' => array( 1 => 'Enabled', 2 => 'Disabled', ), )); $this->addColumn('type', array( 'header'=> Mage::helper('catalog')->__('Type'), 'width' => '60px', 'index' => 'type_id', 'type' => 'options', 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(), ));
Now I want to add the product type column to the drop-down menu so that I can filter products by produt type, i.e. simple, custom, etc.
Editted
Just added this to the function and it worked:
$this->addColumn('type', array( 'header'=> Mage::helper('catalog')->__('Type'), 'width' => '60px', 'index' => 'type_id', 'type' => 'options', 'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(), ));