File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class OrderRepositoryPlugin
23
23
* @param OrderInterface $entity
24
24
* @return array
25
25
* @throws LocalizedException
26
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
26
27
*/
27
28
public function beforeSave (OrderRepository $ subject , OrderInterface $ entity ): array
28
29
{
@@ -60,12 +61,5 @@ private function validateOrderItems(OrderInterface $entity): void
60
61
if (!$ items || count ($ items ) === 0 ) {
61
62
throw new LocalizedException (__ ('Please specify order items. ' ));
62
63
}
63
-
64
- // Validate each item has required data
65
- foreach ($ items as $ item ) {
66
- if (!$ item ->getProductId () || !$ item ->getSku ()) {
67
- throw new LocalizedException (__ ('Order items must have valid product information. ' ));
68
- }
69
- }
70
64
}
71
65
}
Original file line number Diff line number Diff line change 26
26
<plugin name =" add_existing_product_options"
27
27
type =" Magento\Sales\Plugin\Model\ResourceModel\Order\Relation\AddExistingItemProductOptions" />
28
28
</type >
29
+ <type name =" Magento\Sales\Model\OrderRepository" >
30
+ <plugin name =" validate_billing_address_on_save"
31
+ type =" Magento\Sales\Plugin\Model\OrderRepositoryPlugin"
32
+ sortOrder =" 10" />
33
+ </type >
29
34
</config >
You can’t perform that action at this time.
0 commit comments