-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Open
Labels
Area: OrderComponent: order statusIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.4-p7Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch
Description
Preconditions and environment
- Magento 2.4.4-p7
Steps to reproduce
- Create an order containing: 1 physical item of quantity = 2 and 1 virtual item of quantity = 5
- Invoice the order
- Refund 1 quantity of the physical item
- Ship 1 quantity of the physical item
Expected result
Order state should be complete.
Actual result
Order state is still processing.
Additional information
Problem comes from magento/module-sales/Model/ResourceModel/Order/Handler/State.php
In the isPartiallyRefundedOrderShipped
, the code compares the total qty ordered with the sum of total qty shipped and total qty refunded.
However, virtual items are not considered when retrieving the total qty shipped, preventing the method from returning true.
Here's the fix that I have used to resolve the issue:
diff --git a/src/vendor/magento/module-sales/Model/ResourceModel/Order/Handler/State.php b/src/vendor/magento/module-sales/Model/ResourceModel/Order/Handler/State.php
index 51c45ed5e5..8d97ce01cb 100644
--- module-sales/Model/ResourceModel/Order/Handler/State.php
+++ module-sales/Model/ResourceModel/Order/Handler/State.php
@@ -97,1 +97,3 @@ class State
- $numOfShippedItems += (int)$item->getQtyShipped();
+ $numOfShippedItems += $item->getIsVirtual()
+ ? (int)$item->getQtyOrdered()
+ : (int)$item->getQtyShipped();
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”.
digitalrisedorset
Metadata
Metadata
Assignees
Labels
Area: OrderComponent: order statusIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressReported on 2.4.4-p7Indicates original Magento version for the Issue report.Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchThe issue has been reproduced on latest 2.4-develop branch