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

编程入门 行业动态 更新时间:2024-10-11 17:19:13
在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', ) ));

更多推荐

本文发布于:2023-08-08 00:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466689.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   网格   属性   如何在   产品

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!