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
2323 * @param OrderInterface $entity
2424 * @return array
2525 * @throws LocalizedException
26+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
2627 */
2728 public function beforeSave (OrderRepository $ subject , OrderInterface $ entity ): array
2829 {
@@ -60,12 +61,5 @@ private function validateOrderItems(OrderInterface $entity): void
6061 if (!$ items || count ($ items ) === 0 ) {
6162 throw new LocalizedException (__ ('Please specify order items. ' ));
6263 }
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- }
7064 }
7165}
Original file line number Diff line number Diff line change 2626 <plugin name =" add_existing_product_options"
2727 type =" Magento\Sales\Plugin\Model\ResourceModel\Order\Relation\AddExistingItemProductOptions" />
2828 </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 >
2934</config >
You can’t perform that action at this time.
0 commit comments