I got a issue about export our shipment information. Before i start with this issue, i add the "shipping method"column, is called customizing column, on shipment grid!
Like this,
app/code/core/Mage/Adminhtml/Block/Sales/Shipment/Grid.php
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'));*/
$collection->getSelect()->join('sales_flat_order', 'main_table.entity_id = sales_flat_order.entity_id',array('shipping_method'));
$this->setCollection($collection);
return parent::_prepareCollection();
}
protected function _prepareColumns()
{
parent::_prepareColumns();
$this->removeColumn('created_at');
$methods = Mage::getSingleton('shipping/config')->getActiveCarriers();
$shippingmethods = array();
foreach($methods as $_ccode => $_carrier) {
if($_methods = $_carrier->getAllowedMethods()) {
if(!$_title = Mage::getStoreConfig("carriers/$_ccode/title"))
$_title = $_ccode;
foreach($_methods as $_mcode => $_method) {
$_code = $_ccode . '_' . $_mcode;
$shippingmethods[$_code]= $_title;
}
}
}
$this->addColumn('created_at', array(
'header' => Mage::helper('sales')->__('Date Shipped'),
'index' => 'created_at',
'type' => 'datetime',
'filter_index' => 'main_table.created_at'
));
$this->addColumn('shipping_method', array(
'header'=> Mage::helper('sales')->__('Shipping Method'),
'width' => '80px',
'type' => 'options',
'index' => 'shipping_method',
'options' => $shippingmethods,
));
$this->addExportType('//exportCsv', Mage::helper('sales')->('CSV')); $this->addExportType('//exportExcel', Mage::helper('sales')->('Excel XML'));
return $this; } I can see the column i created but after export On the sales -> shipment on back-end page, i faced this issue!
ERR (3): Warning: SimpleXMLElement::__construct(): </html> in /home/kbethos/public_html/wh-clone/app/code/core/Mage/AdminNotification/Model/Feed.php on line 173
I guess it is resulted from that i deal with nothing with database. So The back-end page didn't bring the shipping method value from the table.
Do i need to join the tables directly?
The table which has the shipment grid informaion is "sales_flat_shipment_grid" And there is shipping description(shipping method) on "sales_flat_order"
Then, How can i export these grid info ? Thank you