/ Published in: PHP
Add the below commented sections into the appropriate functions in your /app/code/core/Mage/Adminhtml/Block/Sales/Order/Grid.php and you'll be good to go! This has been (personally) tested with 1.6.1.0
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* You will need to edit/replace your $collection declaration in _prepareCollection() */ $collection = Mage::getResourceModel($this->_getCollectionClass()) 'sales/order_item', '`sales/order_item`.order_id=`main_table`.entity_id', 'skus' => new Zend_Db_Expr('group_concat(`sales/order_item`.sku SEPARATOR ",")'), 'names' => new Zend_Db_Expr('group_concat(`sales/order_item`.name SEPARATOR ",")'), 'quantities' => new Zend_Db_Expr('group_concat(`sales/order_item`.qty_ordered SEPARATOR ",")'), ) ); $collection->getSelect()->group('entity_id'); /* You will then need to add new columns in _prepareColumns() */ 'header' => Mage::helper('Sales')->__('Skus'), 'width' => '100px', 'index' => 'skus', 'type' => 'text', )); 'header' => Mage::helper('Sales')->__('Name'), 'width' => '100px', 'index' => 'names', 'type' => 'text', ));
URL: http://www.magentocommerce.com/boards/viewthread/218158/