My customers by orders total only returns 5 results for any given report. If I choose day, or month or year. I only get the top 5. Any ideas why it wont show all of them? I dont see any errors on the page
1 Answer
Answer
This is a hard limit imposed by Magento in the Mage_Adminhtml_Block_Report_Grid
class - though it can be overridden.
If you'd like to change it there aren't really a bunch of options. I would rewrite the report grid itself:
Create a module which rewrites Mage_Adminhtml_Block_Report_Customer_Totals_Grid
and overrides the setting at the parent class for this particular grid:
class Your_Module_Block_Adminhtml_CustomerTotalsGrid extends Mage_Adminhtml_Block_Report_Customer_Totals_Grid
{
//whatever arbitrary value you want
protected $_subReportSize = 12;
Rant
First of all this report (and most of the sales reports with subreport abilities) has the ability to be totally atrocious.
Based on the value of System > Config > Sales > Dashboard > Use Aggregated Data
this report may run against live database tables. LIVE. DATABASE. TABLES.
It joins on the sales tables in Magento and generates the report by doing queries in loops. Yes. That's right. Oh, also? That 5 result limit is imposed by the block, yet Magento loads the entirety of the data set in the collection.
This means that the admin can adversely affect table locking of the live site by repeatedly running queries for the day in question which effectively introduces a model load in a loop; while only ever returning the top 5.
/rant
-
Rant = instant perma band. I'm sending the dogs after you, Florida man. JK gud ansr m8.– benmarksCommented Sep 8, 2015 at 14:51
-
3I'll revise to be less... dogmatic. It must be all this Florida meth finally getting to me... Commented Sep 8, 2015 at 14:52
-
1Heh, I think it's good context. If anything I'd just reverse the order and put the answer on top.– benmarksCommented Sep 8, 2015 at 15:03
-