I have about 20 clients that are using Recurring Profiles for memberships. The profiles run just fine and when someone signs up, it all sets up just fine (using Stripe), and charges monthly like it should. The issue that I have is that the Total Sales that are reflected on the Dashboard is not being updated with the revenue generated when a Recurring Profile cycles. It is only updated when there is a new Order. If that Order is a Recurring Profile, then it's registered in the Total Sales one time and never again after that.
Using OpenCart v3.0.2.0.
Any assistance will be awesome!
One simplistic way of accomplishing your request would be to edit your admin/model/extension/dashboard/sale.php file.
Find:
replace with:
This should resolved the issue.
Find:
Code: Select all
public function getTotalSales($data = array()) {
$sql = "SELECT SUM(total) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id > '0'";
if (!empty($data['filter_date_added'])) {
$sql .= " AND DATE(date_added) = DATE('" . $this->db->escape($data['filter_date_added']) . "')";
}
$query = $this->db->query($sql);
return $query->row['total'];
}
Code: Select all
public function getTotalSales($data = array()) {
$sql = "SELECT SUM(`o`.`total`) AS `total` FROM `" . DB_PREFIX . "order` `o` LEFT JOIN `" . DB_PREFIX . "order_recurring` `or` ON (`or`.`order_id` = `o`.`order_id`) LEFT JOIN `" . DB_PREFIX . "order_recurring_transaction` `ort` ON (`ort`.`order_recurring_id` = `or`.`order_recurring_id`) WHERE `o`.`order_status_id` > '0'";
if (!empty($data['filter_date_added'])) {
$sql .= " AND DATE(`o`.`date_added`) = DATE('" . $this->db->escape($data['filter_date_added']) . "')";
}
$query = $this->db->query($sql);
return $query->row['total'];
}
Dedication and passion goes to those who are able to push and merge a project.
Regards,
Straightlight
Programmer / Opencart Tester
Who is online
Users browsing this forum: No registered users and 48 guests