php - How to add custom field in to order grid for magento admin panel -
i have query order grid in magento admin panel. have display purchase products there qty, total weight particular order, weight unit. can 1 me how can achieve task.
i tried many solution not getting it.
you can use renderer add custom field code in config.xml
<core_block_abstract_prepare_layout_before> <observers> <core_block_abstract_prepare_layout_before_handler> <type>model</type> <class>adminordergridcustom/observer</class> <method>adminordergridcolumn</method> <args></args> </core_block_abstract_prepare_layout_before_handler> </observers> </core_block_abstract_prepare_layout_before>
your code in observer.php file
public function adminordergridcolumn(varien_event_observer $observer) { $block = $observer->getevent()->getblock(); if($block instanceof mage_adminhtml_block_sales_order_grid) { $block->addcolumnafter('qty', array( 'header' => mage::helper('sales')->__('qty'), 'index' => 'qty', ),'imported'); } } need add column 'qty' in database 'sales_flat_order' table
and update field on event . value in grid.
Comments
Post a Comment