在Magento 1.6.1中将SKU列添加到订单网格
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了在Magento 1.6.1中将SKU列添加到订单网格相关的知识,希望对你有一定的参考价值。
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
/* 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', ));
以上是关于在Magento 1.6.1中将SKU列添加到订单网格的主要内容,如果未能解决你的问题,请参考以下文章
如何在magento中将订单详细信息传递给paypal express checkout?
Magento 2:从数据库中获取产品、Sku 和制造商名称