【问题标题】:Where is The Abandoned Cart Report Located in Magento?Magento 中的废弃购物车报告位于何处?
【发布时间】:2011-04-13 21:12:52
【问题描述】:

我想看看废弃的购物车报告是如何生成的(它使用什么模型)。

我希望添加拆分客户名字和姓氏的功能,因为我们希望使用此功能将信息从 Magento 导入我们的电子邮件列表管理程序。

有谁知道这个报告是从哪里生成的或者它使用什么对象?

【问题讨论】:

    标签: magento report


    【解决方案1】:

    我发现网格是在以下位置生成的:

    /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
            ));
    

    【讨论】:

    • 在您解决自己的问题时发布回复,感谢您不是无助的 Magento 用户!
    • 我总是尽量回应自己的问题。我不可能是唯一一个有这些问题的人。作为一名程序员,我有时会觉得被 Magento 打败了,所以我会尽力提供帮助。非常感谢您对社区的贡献。你的教程对我的帮助比你知道的要多。
    猜你喜欢
    • 2015-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-01-16
    • 1970-01-01
    • 2012-03-02
    • 1970-01-01
    相关资源
    最近更新 更多