Post by ibrunomaciel » Fri Aug 07, 2015 7:13 pm

Hello!

I need a feature that when I click on Delete button (Orders History on admin panel of 1.5.6.x) the order don't be deleted, but changes it to "abandoned carts orders".

It's possible?

Newbie

Posts

Joined
Fri Aug 07, 2015 7:07 pm

Post by IP_CAM » Sat Aug 08, 2015 5:38 am

>abandoned carts orders<
does this already exist, in some form ?
Ernie

My Github OC Site: https://github.com/IP-CAM
5'600 + FREE OC Extensions, on the World's largest private Github OC Repository Archive Site.


User avatar
Legendary Member

Posts

Joined
Tue Mar 04, 2014 1:37 am
Location - Switzerland

Post by ibrunomaciel » Sat Aug 08, 2015 11:20 am

Hi IP_CAM !
In my Opencart yes (option 0 of the form select), I don't know if it's by default or an extension.

I see that on database: order > order_status_id (column), all of the abandoned orders values are 0.

Newbie

Posts

Joined
Fri Aug 07, 2015 7:07 pm

Post by pprmkr » Sat Aug 08, 2015 1:01 pm

ibrunomaciel wrote:Hello!

I need a feature that when I click on Delete button (Orders History on admin panel of 1.5.6.x) the order don't be deleted, but changes it to "abandoned carts orders".

It's possible?
Edit admin/model/sale/order.php

Change:

Code: Select all

	public function deleteOrder($order_id) {
Into:

Code: Select all

	public function deleteOrder($order_id) {
	
		$this->db->query("UPDATE `" . DB_PREFIX . "order` SET order_status_id = '0', date_modified = NOW() WHERE order_id = '" . (int)$order_id . "'");

		$this->db->query("INSERT INTO " . DB_PREFIX . "order_history SET order_id = '" . (int)$order_id . "', order_status_id = '0', notify = '0', comment = 'DELETED by ADMIN', date_added = NOW()");

	}
			
	public function deleteOrder2($order_id) {

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands
Who is online

Users browsing this forum: No registered users and 9 guests