0

when I export shipments on Magento admin ( Sales > Shipments > export (to csv) ) I'd like to export Shipping method(carrier) too. How can I do that? Thank you

1 Answer 1

1

You can do this by override Mage_Adminhtml_Block_Sales_Order_Grid Just need to change prepareCollection funcion with the below code:

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

and after that add a column for shipping method:

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

Now try exporting the csv.

Your Answer

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

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