-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v2.4.7-p1 Magento reorder -1 order numbers #39089
Comments
Hi @sgeleon. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-Bravo. Thank you for working on this issue.
|
I have also tried this now its working fine |
Are there any actual issues being caused with the hyphen in order string? I believe alpha numerical with hyphen is widely accepted for order numbers and I have seen other systems use incremental for reorders as well. |
@magento give me 2.4-develop instance |
Hi @engcom-Bravo. Thank you for your request. I'm working on Magento instance for you. |
Hi @engcom-Bravo, here is your Magento Instance: https://e7daaa19f82979722b9e29636ed6d495.instances-prod.magento-community.engineering |
Hi @sgeleon, Thanks for your reporting and collaboration. We have verified the issue in Latest 2.4-develop instance and the issue is reproducible.Kindly refer the screenshots. The order number is the same 8 digits as the previous order with “-1” added to the end.from frontend it is working fine. Hence Confirming the issue. Thanks. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-12854 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-Bravo. Thank you for verifying the issue. |
Hi @AndresInSpace When an order is edited, the original order is cancelled and a new one is made to replace it. Therefore, it makes sense to have a "-1" appended to the order number and a "Link to the previous" order on the order view page because the new order replaces the old one. When you use the reorder button you are telling Magento you want to place a brand new order that is similar to the previous one but that does not replace it. The reorder button is just a shortcut to order the same products for the same client instead of having to go through the new order process from scratch. It doesn't make any sense from the admin or customer side to use "-1" and "Link to the previous order" in this case. Magento previously treated editing and reordering differently, now it is treating them the same. This is incorrect. |
for anyone else experiencing this issue i opted to revert some of the changes that were made in #37298 diff --git a/Model/AdminOrder/Create.php b/Model/AdminOrder/Create.php
index 4b1868e..a791e2f 100644
--- a/Model/AdminOrder/Create.php
+++ b/Model/AdminOrder/Create.php
@@ -2044,10 +2044,8 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\
private function beforeSubmit(Quote $quote)
{
$orderData = [];
- if ($this->getSession()->getReordered() || $this->getSession()->getOrder()->getId()) {
+ if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
- $oldOrder = $oldOrder->getId() ?
- $oldOrder : $this->orderRepositoryInterface->get($this->getSession()->getReordered());
$originalId = $oldOrder->getOriginalIncrementId();
if (!$originalId) {
$originalId = $oldOrder->getIncrementId();
@@ -2074,16 +2072,12 @@ class Create extends \Magento\Framework\DataObject implements \Magento\Checkout\
*/
private function afterSubmit(Order $order)
{
- if ($this->getSession()->getReordered() || $this->getSession()->getOrder()->getId()) {
+ if ($this->getSession()->getOrder()->getId()) {
$oldOrder = $this->getSession()->getOrder();
- $oldOrder = $oldOrder->getId() ?
- $oldOrder : $this->orderRepositoryInterface->get($this->getSession()->getReordered());
$oldOrder->setRelationChildId($order->getId());
$oldOrder->setRelationChildRealId($order->getIncrementId());
$oldOrder->save();
- if ($this->getSession()->getOrder()->getId()) {
- $this->orderManagement->cancel($oldOrder->getEntityId());
- }
+ $this->orderManagement->cancel($oldOrder->getEntityId());
$order->save();
}
} |
Preconditions and environment
Steps to reproduce
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:
Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: