开发者

Is a multiple period for sales grid collection possible in magento?

开发者 https://www.devze.com 2023-04-12 14:06 出处:网络
In Adminhtml/Block/Report/Sales/Sales/Grid.php I want the grid to have a second criteria that it will be grouped by. So for example if there was a vender name that was associated with a product and th

In Adminhtml/Block/Report/Sales/Sales/Grid.php I want the grid to have a second criteria that it will be grouped by. So for example if there was a vender name that was associated with a product and the user chose a period of month and selected 开发者_运维技巧a checkbox to break down by vendor, the report would be like this

Period | Vendor | Orders | ...

7/2011 | Vendor 1 | 10 | ...

8/2011 | Vendor 2 | 15 | ...

Would I add another period through $collection->setPeriod('vendor')?


there should be a method in that file called _prepareColumns. In that method is where you would add another column.

$this->addColumn('vendor', array(
        'header'        => Mage::helper('sales')->__('Vendor'),
        'index'         => 'vendor',
        'width'         => 100,
        'sortable'      => true,
    ));

Next you need to make sure that the "vendor" field is in data returned to the grid.

0

精彩评论

暂无评论...
验证码 换一张
取 消