Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions core/components/minishop2/docs/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [4.4.2-pl] - 2025-09-29

### Fixed
- Fixed 'remains' and 'reserved' fields
- Fixed order status null

### Added
- Add new filters for orders dashboard


## [4.4.1-pl] - 2025-09-22

Expand Down
9 changes: 6 additions & 3 deletions core/components/minishop2/model/minishop2/minishop2.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class miniShop2
{
public $version = '4.4.0-pl';
public $version = '4.4.2-pl';
/** @var modX $modx */
public $modx;
/** @var pdoFetch $pdoTools */
Expand Down Expand Up @@ -821,6 +821,7 @@ public function changeOrderStatus($order_id, $status_id)
return $this->modx->lexicon($error);
}

$old_status_id = null;
/** @var msOrderStatus $old_status */
$old_status = $this->modx->getObject(
'msOrderStatus',
Expand All @@ -837,15 +838,17 @@ public function changeOrderStatus($order_id, $status_id)
return $this->modx->lexicon($error);
}
}
$old_status_id = $old_status->get('id');
}

if ($order->get('status') == $status_id) {
$error = 'ms2_err_status_same';
return $this->modx->lexicon($error);
}

$response = $this->invokeEvent('msOnBeforeChangeOrderStatus', [
'order' => $order,
'old_status' => $old_status->get('id'),
'old_status' => $old_status_id,
'status' => $status_id,
]);
if (!$response['success']) {
Expand All @@ -858,7 +861,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'),
'old_status' => $old_status_id,
'status' => $status_id,
]);
if (!$response['success']) {
Expand Down
Loading