0

I am try to add extra column on admin order grid and try to filter order with total quantity weight. Please help !!

0

1 Answer 1

0

See at http://www.atwix.com/magento/column-to-orders-grid/

Magento save total weight of order in sales_flat_order field file you nedd to load tis'

at app/code/local/Atwix/ExtendedGrid/Model/Observer.php

public function salesOrderGridCollectionLoadBefore($observer)
    {
        $collection = $observer->getOrderGridCollection();
        $select = $collection->getSelect();
        $select->joinLeft(array('mainorder'=>$collection->getTable('sales/order)), 'mainorder.entity_id=main_table.entity_id',array('weight'=>'weight'));
    }

add app/design/adminhtml/default/default/layout/atwix/extendedgrid.xml at and code is

    <layout>
    <sales_order_grid_update_handle>
        <reference name="sales_order.grid">
            <action method="addColumnAfter">
                <columnId>total_wight</columnId>
                <arguments>
                    <header>Weight</header>
                    <index>total_wight</index>
                    <filter_index>mainorder.weight</filter_index>
                    <type>text</type>
                </arguments>
                <after>shipping_name</after>
            </action>
        </reference>
    </sales_order_grid_update_handle>
    <adminhtml_sales_order_grid>
        <!-- apply layout handle defined above -->
        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_grid>
    <adminhtml_sales_order_index>
        <!-- apply layout handle defined above -->
        <update handle="sales_order_grid_update_handle" />
    </adminhtml_sales_order_index>
</layout>

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