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

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

  • Rant = instant perma band. I'm sending the dogs after you, Florida man. JK gud ansr m8. – benmarks Sep 8 '15 at 14:51
  • 3
    I'll revise to be less... dogmatic. It must be all this Florida meth finally getting to me... – philwinkle Sep 8 '15 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 Sep 8 '15 at 15:03
  • @benmarks revised – philwinkle Sep 11 '15 at 16:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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