我要顯示在Magento如何添加訂單客戶電網的總人數在Magento
我用這個作爲指導的客戶網訂單號: How to add customer "total number of orders" and "total spent" to order grid in magento 1.7
但是這是一個不同的網格
到目前爲止,我已經創建了: 應用程序/代碼/本地/法師/ Adminhtml /座/客戶/ Grid.php
_prepareCollection
我增加:
$orderTableName = Mage::getSingleton('core/resource')
->getTableName('sales/order');
$collection
->getSelect()
->joinLeft(
array('orders' => $orderTableName),
'orders.customer_id=e.entity_id',
array('order_count' => 'COUNT(customer_id)')
);
$collection->groupByAttribute('entity_id');
之前: $這 - > setCollection($集合);
_prepareColumns我說:
$this->addColumn('order_count', array(
'header' => Mage::helper('customer')->__('# orders'),
'index' => 'order_count',
'type' => 'number'
));
,而它在電網工作,我有一些問題:
尋呼機顯示1級的客戶(應爲500+)
排序對這個新列不起作用
我明白這個問題,但我怎麼能覆蓋的getSize功能? – user2807370