2

i want to add out of stock colum to magento admin product listing pages, so that it will be easy to view all low stock iteam easily

how can id do it via magento setting or any module ??

I tried to do it via observer but could make it work

<events>
      <adminhtml_block_html_before>
        <observers>
          <add_customer_group_column>
            <type>model</type>
            <class>customizations/observer</class>
            <method>addCustomerGroupColumn</method>
          </add_customer_group_column>
        </observers>
      </adminhtml_block_html_before>
    </events>

Observer.h

Model/Observer.php

class Devshree_Unidesing_Model_Observer {
    public function addCustomerGroupColumn(Varien_Event_Observer $observer){
        if($observer->getBlock()->getType() == 'adminhtml/sales_order_grid'){
            $block = $observer->getEvent()->getBlock();         
            $sales_order_grid_block = $observer->getBlock();

            $groups = Mage::getResourceModel('customer/group_collection')
            ->addFieldToFilter('customer_group_id', array('gt' => 0))
            ->load()
            ->toOptionHash();

            $block->addColumn('customer_group_id', array(
                'header'    => Mage::helper('customer')->__('Customer Group'),
                'width'     => '100',
                'index'     => 'customer_group_id',
                'type'      => 'options',
                'options'   => $groups,
                ));

            $block->addColumnsOrder('customer_group_id', 'shipping_name');
        }
    }
}

2 Answers 2

3

Quite another answer, but might help: https://magento.stackexchange.com/a/29213/217

Amasty has a module which might fix your problem: Extended Product Grid with Editor

And you can achieve this with GridControl when you join the stock item table into the product grid and add the status to the grid

1
  • installed GridControl where to change to get customer group <join table="sales/order" condition="main_table.entity_id={{table}}.entity_id" field="shipping_description"/>
    – mcoder
    Commented Feb 15, 2015 at 8:26
2

If you want a free solution for this, I can recommend BL_CustomGrids. It's free and makes it possible to customize every grid you have in your admin, even those from installed extensions. Also it makes it possible to edit your data in the grid.

2
  • Does it work well?
    – ladle3000
    Commented Feb 15, 2015 at 17:44
  • Yes, it works great. Although testing in on a test environment is recommended of course. I installed it for a client and he is very happy with it. Commented Feb 16, 2015 at 9:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.