views:

31

answers:

1

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?

Thanks

Josh Pennington

+4  A: 

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
        ));
Josh Pennington
That for posting a response when you solved your own problem, and thank you for not being a helpless Magento user!
Alan Storm
I always try to respond to my own problems when I can. I can't be the only one who has these questions. As a programmer I sometimes feel a little defeated by Magento so I try to help where I can. Your contribution to the community is greatly appreciated. Your tutorials have helped me more than you know.
Josh Pennington