Total sales with specific order status
Posted: Wed Sep 11, 2019 8:04 pm
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
and change the SQL Query to
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)
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'";
Code: Select all
$sql = "SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id = '5'";
done!
(i will check later if i destroyed anything else)