diff --git a/vendor/magento/module-inventory-in-store-pickup-sales/Model/NotifyOrdersAreReadyForPickup.php b/vendor/magento/module-inventory-in-store-pickup-sales/Model/NotifyOrdersAreReadyForPickup.php index a4b2d0a733a8..829f227c9595 100644 --- a/vendor/magento/module-inventory-in-store-pickup-sales/Model/NotifyOrdersAreReadyForPickup.php +++ b/vendor/magento/module-inventory-in-store-pickup-sales/Model/NotifyOrdersAreReadyForPickup.php @@ -108,14 +108,15 @@ public function execute(array $orderIds): ResultInterface foreach ($orderIds as $orderId) { try { $order = $this->orderRepository->get($orderId); - $this->emailNotifier->notify($order); $searchCriteria = $this->searchCriteriaBuilder->addFilter('order_id', $orderId); $shipments = $this->shipmentRepository->getList($searchCriteria->create()); $isShipmentCreated = $shipments->getTotalCount() > 0; if ($isShipmentCreated === false) { + $order->getExtensionAttributes()->setSendNotification(0); $this->createShippingDocument->execute($order); } $this->addStorePickupAttributesToOrder->execute($order); + $this->emailNotifier->notify($order); } catch (LocalizedException $exception) { $errors[] = [ 'id' => $orderId,