Page 1 of 1

Total sales with specific order status

Posted: Wed Sep 11, 2019 8:04 pm
by aerogel
from beginning of ICE AGE(!!!), i always dreamed of having total sales of orders with "Completed" status up on the roof of the Dashboard.
this is how i did it on OC 3.0.2.0.
from admin\model\extension\dashboard\sale.php
find this at line 3

Code: Select all

public function getTotalSales($data = array()) {
$sql = "SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0'";
and change the SQL Query to

Code: Select all

$sql = "SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id = '5'";
you can find all your order status IDs in system>localization section. here "5" is the right id for "completed",
done!
(i will check later if i destroyed anything else)

Re: Total sales with specific order status

Posted: Wed Sep 11, 2019 8:37 pm
by letxobnav
admin\model\extension\report\sale.php?

Re: Total sales with specific order status

Posted: Thu Sep 12, 2019 12:41 am
by aerogel
letxobnav wrote:
Wed Sep 11, 2019 8:37 pm
admin\model\extension\report\sale.php?
i couldn't resist that "question mark" so i checked again!
and i "swear" this is in
admin\model\extension\dashboard\sale.php