Josh Pennington
Josh Pennington

Reputation: 6408

Where is The Abandoned Cart Report Located in Magento?

I would like to see how the abandoned shopping cart report is being generated from (what models it is using).

I am hoping to add the ability to split out the customers first and last names since we want to use this to import the information from Magento into our email list management program.

Does anyone know where this report is generated from or what object it uses?

Upvotes: 12

Views: 7799

Answers (1)

Josh Pennington
Josh Pennington

Reputation: 6408

I found the grid was being generated in the following location:

/app/code/core/Mage/Adminhtml/Block/Report/Shopcart/Abandoned/Grid.php

From there I was able to find the model being used for the abandoned shopping carts was:

$collection = Mage::getResourceModel('reports/quote_collection');
$collection->prepareForAbandonedReport(array(1));
$collection->load();

I was able to get my end goal done by adding two column to the Grid.php file. I did that by doing the following:

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

Upvotes: 19

Related Questions