In Magento, how do I show a custom attribute in a product grid ..?

Thanks in advance

I made one attribute with the yes / no option, I want to show it in the product grid on the admin side, I made a column in the grid and put the following code

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

?>

here the approvedcustomer is an attribute and contains the yes / no option but in the grid it shows 0 and 1, as I can show Approved and Unapproved insted from 0 and 1 ..

Sorry for my English,

thanks again.

Jeet.

+3
source share
1 answer

You should assign an options type to your column.

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

Source: https://habr.com/ru/post/1770242/


All Articles