【发布时间】:2011-04-13 21:12:52
【问题描述】:
我想看看废弃的购物车报告是如何生成的(它使用什么模型)。
我希望添加拆分客户名字和姓氏的功能,因为我们希望使用此功能将信息从 Magento 导入我们的电子邮件列表管理程序。
有谁知道这个报告是从哪里生成的或者它使用什么对象?
【问题讨论】:
我想看看废弃的购物车报告是如何生成的(它使用什么模型)。
我希望添加拆分客户名字和姓氏的功能,因为我们希望使用此功能将信息从 Magento 导入我们的电子邮件列表管理程序。
有谁知道这个报告是从哪里生成的或者它使用什么对象?
【问题讨论】:
我发现网格是在以下位置生成的:
/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php
从那里我能够找到用于废弃购物车的模型是:
$collection = Mage::getResourceModel('reports/quote_collection');
$collection->prepareForAbandonedReport(array(1));
$collection->load();
我能够通过在 Grid.php 文件中添加两列来完成我的最终目标。我通过执行以下操作做到了这一点:
$this->addColumn('customer_firstname', array(
'header' =>Mage::helper('reports')->__('Customer First Name'),
'index' =>'customer_firstname',
'sortable' =>false
));
$this->addColumn('customer_lastname', array(
'header' =>Mage::helper('reports')->__('Customer Last Name'),
'index' =>'customer_lastname',
'sortable' =>false
));
【讨论】: