Mehravish Temkar
Mehravish Temkar

Reputation: 4365

Total Orders on Dashboard

I am trying to get the data of dashboard only for previous month. Say for example I want to change the total orders query for dashboard, I can edit the query of getTotalOrders() in admin\model\sale\order.php accordingly. I was wondering if the same method is used for any other module then it would mess up the data. So instead of editing that method I created my own method say getPreviousMonthTotalOrders(), but I can't figure out how to call this method for dashboard data instead of getTotalOrders().

Upvotes: 1

Views: 402

Answers (1)

Mehravish Temkar
Mehravish Temkar

Reputation: 4365

In the controller admin\controller\common\dashboard.php there is this line:

$output = $this->load->controller('extension/dashboard/' . $code . '/dashboard');

So I checked admin\controller\extension\dashboard\order.php

and changed

$order_total = $this->model_sale_order->getTotalOrders(); 

to

$order_total = $this->model_sale_order->getPreviousMonthTotalOrders();

Upvotes: 1

Related Questions