Решение:
Заходим в admin\model\sale , файл order.php
Находим:
public function getTotalSales() { $query = $this->db->query("SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0'"); return $query->row['total']; } public function getTotalSalesByYear($year) { $query = $this->db->query("SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' AND YEAR(date_added) = '" . (int)$year . "'"); return $query->row['total']; }
Заменяем на:
public function getTotalSales() { $query = $this->db->query("SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' and order_status_id not in (9,1,8,7,17,2)"); return $query->row['total']; } public function getTotalSalesByYear($year) { $query = $this->db->query("SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0' and order_status_id not in (9,1,8,7,17,2) AND YEAR(date_added) = '" . (int)$year . "'"); return $query->row['total']; }
где 9,1,8,7,17,2 ID статусы заказов
Чтобы в "Всего заказов" отображались только оплаченные к заказы к примеру то делаем следующее:
public function getTotalOrders($data = array()) { $sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order`"; if (isset($data['filter_order_status_id']) && !is_null($data['filter_order_status_id'])) { $sql .= " WHERE order_status_id = '" . (int)$data['filter_order_status_id'] . "'"; } else { $sql .= " WHERE order_status_id > '0'"; }
Заменяем на:
public function getTotalOrders($data = array()) { $sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order`"; if (isset($data['filter_order_status_id']) && !is_null($data['filter_order_status_id'])) { $sql .= " WHERE order_status_id = '" . (int)$data['filter_order_status_id'] . "'"; } else { $sql .= " WHERE order_status_id > '0' and order_status_id not in (9,1,8,7,17,2)"; }
где 9,1,8,7,17,2 ID статуса заказа
На этом всё.