From 1aef04752362dcf4c11f4ce6e5c4687fb3183ac5 Mon Sep 17 00:00:00 2001 From: lexsmil Date: Sat, 26 Oct 2024 02:50:37 +0300 Subject: [PATCH] add old_status to msOnBeforeChangeStatus and msOnChangeStatus events --- core/components/minishop2/model/minishop2/minishop2.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/components/minishop2/model/minishop2/minishop2.class.php b/core/components/minishop2/model/minishop2/minishop2.class.php index 66c938b5..e663196e 100644 --- a/core/components/minishop2/model/minishop2/minishop2.class.php +++ b/core/components/minishop2/model/minishop2/minishop2.class.php @@ -843,7 +843,8 @@ public function changeOrderStatus($order_id, $status_id) $response = $this->invokeEvent('msOnBeforeChangeOrderStatus', [ 'order' => $order, - 'status' => $order->get('status'), + 'old_status' => $old_status->get('id'), + 'status' => $status_id, ]); if (!$response['success']) { return $response['message']; @@ -855,6 +856,7 @@ public function changeOrderStatus($order_id, $status_id) $this->orderLog($order->get('id'), 'status', $status_id); $response = $this->invokeEvent('msOnChangeOrderStatus', [ 'order' => $order, + 'old_status' => $old_status->get('id'), 'status' => $status_id, ]); if (!$response['success']) {