Open
Description
Preconditions and environment
- Magento version - 2.4.7
Steps to reproduce
- Open any order
- Click reorder
- Submit the order
Expected result
The order number is unique 8 digits.
Actual result
The order number is the same 8 digits as the previous order with “-1” added to the end.
Additional information
Early before version 2.4.7, when we recreated an order, you would get a new unique number. In version 2.4.7, you get a number with the postfix '-1' added to the end. This appeared after the bug fix. [Sales] Missing relation data when reorder.
To fix this behavior, I suggest the following:
Index: vendor/magento/module-sales/Model/AdminOrder/Create.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/vendor/magento/module-sales/Model/AdminOrder/Create.php b/vendor/magento/module-sales/Model/AdminOrder/Create.php
--- a/vendor/magento/module-sales/Model/AdminOrder/Create.php
+++ b/vendor/magento/module-sales/Model/AdminOrder/Create.php (date 1724315876294)
@@ -2056,10 +2056,13 @@
'original_increment_id' => $originalId,
'relation_parent_id' => $oldOrder->getId(),
'relation_parent_real_id' => $oldOrder->getIncrementId(),
- 'edit_increment' => $oldOrder->getEditIncrement() + 1,
- 'increment_id' => $originalId . '-' . ($oldOrder->getEditIncrement() + 1)
+ 'edit_increment' => $oldOrder->getEditIncrement() + 1
];
- $quote->setReservedOrderId($orderData['increment_id']);
+
+ if($this->getSession()->getOrder()->getId()) {
+ $orderData['increment_id'] = $originalId . '-' . ($oldOrder->getEditIncrement() + 1);
+ $quote->setReservedOrderId($orderData['increment_id']);
+ }
}
return $orderData;
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.