Add Shipment to Adminhtml Order List Grid

本文详细阐述了如何重构电商订单网格文件,包括重写gridblockfile,编辑prepareCollection函数以左连接销售扁平订单表,并在prepareColumns中添加物流描述列,以提升订单管理效率。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. rewrite the grid block file

<global>
        <blocks>
            <adminhtml>
                <rewrite>
                   <sales_order_grid>Raveinfosys_Deleteorder_Block_Adminhtml_Sales_Order_Grid</sales_order_grid>
                </rewrite>	

 2. edit _prepareCollection function to left join ·sales_flat_order· table

    protected function _prepareCollection()
    {
        $collection = Mage::getResourceModel($this->_getCollectionClass());
        $collection->getSelect()->joinLeft(array('b'=>'sales_flat_order'),'b.entity_id = main_table.entity_id',array('shipping_description'));
        $this->setCollection($collection);
        return parent::_prepareCollection();
    }

 3.add a 'shipping_description' column to _prepareColumns()function

 $this->addColumn('shipping_description', array(
        		'header' => Mage::helper('sales')->__('Shipping Method'),
        		'index' => 'shipping_description'
        ));

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值