How to add column Date Shipped to Sales Order Grid magento -



How to add column Date Shipped to Sales Order Grid magento -

i'm stuck adding column sales order grid shipment grid. problem is: "purchased on" in db has name "created_at", "date shipped" has name "created_at", when bring together "created_at" "sales_flat_shipment_grid" see purchased on date name date shipped. i'm using code: in _preparecollection()

$collection->getselect()->joinleft(array('sfsg'=>'sales_flat_shipment_grid'),'sfsg.order_increment_id=main_table.increment_id',array('sfsg.created_at'));

and in _preparecolumns()

$this->addcolumn('created_at', array( 'header' => mage::helper('sales')->__('date shipped'), 'index' => 'created_at', 'type' => 'datetime', 'filter_index'=>'sfsg.created_at', ));

could please help me this?

after few hours of trying i've found reply in case is: in _preparecollection() add

$collection->getselect()->joinleft(array('sfsg'=>$resource->gettablename('sales_flat_shipment_grid')),'sfsg.order_increment_id=main_table.increment_id',array(

'shiped' => new zend_db_expr('group_concat(sfsg.created_at separator " | ")'), ));

and in _preparecolums()

$this->addcolumn('shiped', array( 'header' => mage::helper('sales')->__('date shipped'), 'index' => 'shiped', 'type' => 'datetime', 'filter_index'=>'sfsg.created_at', ));

magento

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -