Post by joemaydew » Tue Sep 26, 2017 10:12 pm

I have an old version of opencart that my user has a count of different orders in different status using the Macro Dashboard module

I would like to know how I can achieve this on version 2.3.0.2.

To Clarify I would like a count of processing orders on the dashboard along with a count of pending orders etc along with any other order status that I create. On the old version this was done by counting the database order status id number i think.

User avatar
New member

Posts

Joined
Wed May 07, 2014 4:58 pm
Location - Staffordshire, United Kingdom

Post by yodapt » Tue Sep 26, 2017 10:16 pm


Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by joemaydew » Tue Sep 26, 2017 10:17 pm

Yes indeed. I modified that extension to have counts of different order status but I now need to be able to do this on version 2.3.0.2

User avatar
New member

Posts

Joined
Wed May 07, 2014 4:58 pm
Location - Staffordshire, United Kingdom

Post by yodapt » Tue Sep 26, 2017 11:08 pm

Can you share the modifications you made?

Opencart Developer - My Extension Showcase
Contact me at aeon.yoda@gmail.com


User avatar
Active Member

Posts

Joined
Fri Jun 17, 2011 6:39 pm


Post by joemaydew » Tue Sep 26, 2017 11:40 pm

The macro dashboard has functions like below and all I did was add another function and changed the order_status_id

Code: Select all

public function getTotalPendingOrdersForMacroDashboard($store_id) {
		$sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id = '1'";

		if($store_id!="")
            $sql .= " AND store_id=$store_id";

		$query = $this->db->query($sql);

		return $query->row['total'];
	}
    
	public function getTotalProcessingOrdersForMacroDashboard($store_id) {
		$sql = "SELECT COUNT(*) AS total FROM `" . DB_PREFIX . "order` WHERE order_status_id = '2'";

		if($store_id!="")
            $sql .= " AND store_id=$store_id";

		$query = $this->db->query($sql);

		return $query->row['total'];
	}

User avatar
New member

Posts

Joined
Wed May 07, 2014 4:58 pm
Location - Staffordshire, United Kingdom
Who is online

Users browsing this forum: No registered users and 30 guests