Skip to main content
added 16 characters in body
Source Link

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array(
    'header'    => Mage::helper('reports')->__('Product Color'),
    'sortable'  => false,
    'index'     => 'color',
    'type'      => 'options',
));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection')
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->filterByIsQtyProductTypes()
            ->joinInventoryItem('qty')
            ->useManageStockFilter($storeId)
            ->useNotifyStockQtyFilter($storeId)
            ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to do something in this collection.

Thanks,

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array(
    'header'    => Mage::helper('reports')->__('Product Color'),
    'sortable'  => false,
    'index'     => 'color',
    'type'      => 'options',
));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection')
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->filterByIsQtyProductTypes()
            ->joinInventoryItem('qty')
            ->useManageStockFilter($storeId)
            ->useNotifyStockQtyFilter($storeId)
            ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to this collection.

Thanks,

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array(
    'header'    => Mage::helper('reports')->__('Product Color'),
    'sortable'  => false,
    'index'     => 'color',
    'type'      => 'options',
));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection')
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->filterByIsQtyProductTypes()
            ->joinInventoryItem('qty')
            ->useManageStockFilter($storeId)
            ->useNotifyStockQtyFilter($storeId)
            ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to do something in this collection.

Thanks,

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array( 'header' =>Mage::helper('reports')->__('Product Color'), 'sortable' =>false, 'index' =>'color', 'type' => 'options', ));

$this->addColumn('color', array(
    'header'    => Mage::helper('reports')->__('Product Color'),
    'sortable'  => false,
    'index'     => 'color',
    'type'      => 'options',
));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection') ->addAttributeToSelect('*') ->setStoreId($storeId) ->filterByIsQtyProductTypes() ->joinInventoryItem('qty') ->useManageStockFilter($storeId) ->useNotifyStockQtyFilter($storeId) ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

$collection = Mage::getResourceModel('reports/product_lowstock_collection')
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->filterByIsQtyProductTypes()
            ->joinInventoryItem('qty')
            ->useManageStockFilter($storeId)
            ->useNotifyStockQtyFilter($storeId)
            ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to this collection.

Thanks,

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array( 'header' =>Mage::helper('reports')->__('Product Color'), 'sortable' =>false, 'index' =>'color', 'type' => 'options', ));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection') ->addAttributeToSelect('*') ->setStoreId($storeId) ->filterByIsQtyProductTypes() ->joinInventoryItem('qty') ->useManageStockFilter($storeId) ->useNotifyStockQtyFilter($storeId) ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to this collection.

Thanks,

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array(
    'header'    => Mage::helper('reports')->__('Product Color'),
    'sortable'  => false,
    'index'     => 'color',
    'type'      => 'options',
));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection')
            ->addAttributeToSelect('*')
            ->setStoreId($storeId)
            ->filterByIsQtyProductTypes()
            ->joinInventoryItem('qty')
            ->useManageStockFilter($storeId)
            ->useNotifyStockQtyFilter($storeId)
            ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to this collection.

Thanks,

Source Link

how to get the option label instead of option value in magento admin panel grid?

I am rewriting the magento admin panel grid for low stack products. In that I have added the new column color in the grid.But this column shows the attribute value instead of showing label. Below is my code which I added in grid.php

$this->addColumn('color', array( 'header' =>Mage::helper('reports')->__('Product Color'), 'sortable' =>false, 'index' =>'color', 'type' => 'options', ));

and below is the default collection in grid.php file.I didn't do anything in the collection.

$collection = Mage::getResourceModel('reports/product_lowstock_collection') ->addAttributeToSelect('*') ->setStoreId($storeId) ->filterByIsQtyProductTypes() ->joinInventoryItem('qty') ->useManageStockFilter($storeId) ->useNotifyStockQtyFilter($storeId) ->setOrder('qty', Varien_Data_Collection::SORT_ORDER_ASC);

I am not sure if I have to this collection.

Thanks,