4

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
  • Voting to reopen
    – philwinkle
    Commented Sep 8, 2015 at 3:08

1 Answer 1

4

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

4
  • Rant = instant perma band. I'm sending the dogs after you, Florida man. JK gud ansr m8.
    – benmarks
    Commented Sep 8, 2015 at 14:51
  • 3
    I'll revise to be less... dogmatic. It must be all this Florida meth finally getting to me...
    – philwinkle
    Commented Sep 8, 2015 at 14:52
  • 1
    Heh, I think it's good context. If anything I'd just reverse the order and put the answer on top.
    – benmarks
    Commented Sep 8, 2015 at 15:03
  • @benmarks revised
    – philwinkle
    Commented Sep 11, 2015 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.