在Magento中如何在产品网格中显示自定义属性..?(In Magento how to show custom attribute in product grid ..?)

提前致谢

我已经创建了一个属性,选项为是/否我想在管理端的产品网格中显示这个我在网格中创建了列并放入以下代码

<?php $this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', )); ?>

这里approvedcustomer是属性,它包含选项是/否但在网格中它显示0和1我如何显示批准和未批准的0和1的投影..

对不起我的英语不好,

再次感谢。

截拳道。

Thanks in advance

i have made one attribute with option of yes/no i want to show this in product grid at admin side i made the column in the grid and put the following code

<?php $this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', )); ?>

here approvedcustomer is attribute and it contains option yes/no but in grid it shows 0 and 1 how can i show Approved and Unapproved insted of 0 and 1..

sorry for my english,

thanks once again.

Jeet.

最满意答案

您应该为列指定“ 选项 ”类型。

$this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', 'type' => 'options', 'options' => array( 0 => 'No', 1 => 'Yes', ) ));

You should assign "options" type for your column.

$this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', 'type' => 'options', 'options' => array( 0 => 'No', 1 => 'Yes', ) ));在Magento中如何在产品网格中显示自定义属性..?(In Magento how to show custom attribute in product grid ..?)

提前致谢

我已经创建了一个属性,选项为是/否我想在管理端的产品网格中显示这个我在网格中创建了列并放入以下代码

<?php $this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', )); ?>

这里approvedcustomer是属性,它包含选项是/否但在网格中它显示0和1我如何显示批准和未批准的0和1的投影..

对不起我的英语不好,

再次感谢。

截拳道。

Thanks in advance

i have made one attribute with option of yes/no i want to show this in product grid at admin side i made the column in the grid and put the following code

<?php $this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', )); ?>

here approvedcustomer is attribute and it contains option yes/no but in grid it shows 0 and 1 how can i show Approved and Unapproved insted of 0 and 1..

sorry for my english,

thanks once again.

Jeet.

最满意答案

您应该为列指定“ 选项 ”类型。

$this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', 'type' => 'options', 'options' => array( 0 => 'No', 1 => 'Yes', ) ));

You should assign "options" type for your column.

$this->addColumn('approvedcustomer', array( 'header'=> Mage::helper('catalog')->__('UrgeStatus'), 'index' => 'approvedcustomer', 'type' => 'options', 'options' => array( 0 => 'No', 1 => 'Yes', ) ));