4
私のカスタムモジュールでは、すべての製品をロードするグリッドを作成しました。私は、列が既に追加された次のいる:Magentoのグリッドに製品タイプフィルタを追加するadmin
$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(),
));
は、今私は、IE、私はprodutの種類によって製品をフィルタリングすることができるようにドロップダウンと製品タイプの列を追加する簡単な、設定可能など
EDITTED
ジャスト機能にこれを追加し、それが働いた:
$this->addColumn('type', array(
'header'=> Mage::helper('catalog')->__('Type'),
'width' => '60px',
'index' => 'type_id',
'type' => 'options',
'options' => Mage::getSingleton('catalog/product_type')->getOptionArray(),
));