如何在Magento的Products Bestsellers Report工具中添加SKU专栏?

时间:2016-06-17 12:01:05

标签: php magento

我想在Magento 1.9.2中的产品畅销书报告中添加 SKU 新专栏。

Admin->reports->product->bestsellers report

我不知道如何添加它。

请建议。

2 个答案:

答案 0 :(得分:0)

您需要覆盖负责网格数据的Mage_Adminhtml_Block_Report_Sales_Bestsellers_Grid Block。

在覆盖后添加如下内容:

$this->addColumn('product_sku', array(
        'header'    => Mage::helper('sales')->__('Product Sku'),
        'index'     => 'product_sku',
        'type'      => 'string',
        'sortable'  => false
    ));

可在/ public_html / app / code / core / Mage / Adminhtml / Block / Report / Sales /畅销书

找到

完成上述操作后,您可以看到一个新列,但没有SKU数据。

现在有两种方法可以填充sku数据,如下所示:

首先:更改表sales_bestsellers_aggregated_daily并添加名为product_sku的列,然后您需要扩展Model类以确保填充此字段就像产品名称一样。

第二:您需要创建一个渲染器,就像在上面的块文件中使用日期一样,这里的技巧是使用产品ID并直接获取SKU并将其显示在网格中。

希望这有帮助

答案 1 :(得分:0)

请参阅此链接获取完美答案

go at this link