Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Make "today" Default In Dashboard > Home Rate Topic   - - - - -

 
  • alijaved
  • Advanced Member
  • Members
  • Join Date: 14-Apr 18
  • 124 posts

Posted 19 August 2018 - 02:23 PM #1

Dear members, 

 

 

Please check this image: http://prntscr.com/kkfgrr

 

Now I will tell you about this, every day I log in and I change the stats from monthly to Today. When I log out and log in again, it changes back to monthly statistics in Admin dashboard> home.

 

 

Is there a way that I can make the sales stats from monthly to today as a default for all the admins?

 

So whenever they log in they will only see Todays stats on the homepage even If they log out and log back in it won't change.

 

 



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11664 posts

Posted 19 August 2018 - 07:34 PM #2

In app/controllers/backend/index.php

Change the line:

$time_period = DateTimeHelper::getPeriod(DateTimeHelper::PERIOD_MONTH_AGO_TILL_NOW);

to

$time_period = DateTimeHelper::getPeriod(DateTimeHelper::PERIOD_TODAY);

Or a better (uptrade independent) method is to create the file:

  app/addons/my_changes/controllers/backend/index.pre.php

and have it contain:

<?php
if( $mode == 'index' && !isset($_REQUEST['time_period']) ) {
  $_REQUEST['time_period'] = DateTimeHelper::PERIOD_TODAY;
}

This should set the REQUEST parameter 'time_period' to TODAY when it's not set and this is the home page.  It should be picked up as if it were passed as part of the URL.

Not tested but low risk.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.