diff --git a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php index ea4fdc994d682..fb6fc3be61375 100644 --- a/app/code/Magento/CatalogInventory/Model/StockStateProvider.php +++ b/app/code/Magento/CatalogInventory/Model/StockStateProvider.php @@ -160,7 +160,7 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ } if (!$this->checkQty($stockItem, $summaryQty) || !$this->checkQty($stockItem, $qty)) { - $message = __('We don\'t have as many "%1" as you requested.', $stockItem->getProductName()); + $message = __('The requested qty is not available'); $result->setHasError(true)->setMessage($message)->setQuoteMessage($message)->setQuoteMessageIndex('qty'); return $result; } else { @@ -212,7 +212,7 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ } } elseif ($stockItem->getShowDefaultNotificationMessage()) { $result->setMessage( - __('We don\'t have as many "%1" as you requested.', $stockItem->getProductName()) + __('The requested qty is not available') ); } } diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php index 44bbd90cc6a2d..4c653ab9ae33f 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Controller/Cart/UpdateItemQtyTest.php @@ -113,7 +113,7 @@ public function requestDataProvider(): array 'request' => ['qty' => 230], 'response' => [ 'success' => false, - 'error_message' => 'We don\'t have as many "Simple Product" as you requested.'] + 'error_message' => 'The requested qty is not available'] ], ]; } diff --git a/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php b/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php index 636239ee7a52e..02f031fae336a 100644 --- a/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php +++ b/dev/tests/integration/testsuite/Magento/Multishipping/Controller/Checkout/CheckItemsTest.php @@ -163,7 +163,7 @@ public function requestDataProvider(): array 'request' => ['qty' => 101], 'response' => [ 'success' => false, - 'error_message' => 'We don\'t have as many "Simple Product" as you requested.'] + 'error_message' => 'The requested qty is not available'] ], [ 'request' => ['qty' => 230], diff --git a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php index 39db5b1572cb7..23df0acdc7822 100644 --- a/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php +++ b/dev/tests/integration/testsuite/Magento/Quote/Model/QuoteTest.php @@ -324,7 +324,7 @@ public function testAddProductUpdateItem() $this->assertEquals(1, $quote->getItemsQty()); $this->expectException(\Magento\Framework\Exception\LocalizedException::class); - $this->expectExceptionMessage('We don\'t have as many "Simple Product" as you requested.'); + $this->expectExceptionMessage('The requested qty is not available'); $updateParams['qty'] = $productStockQty + 1; $quote->updateItem($updateParams['id'], $updateParams); } diff --git a/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php b/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php index 31aa8aafd94d9..f3e528b9c0d28 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php +++ b/dev/tests/integration/testsuite/Magento/Sales/_files/order_info.php @@ -85,6 +85,9 @@ $invoice = $invoiceFactory->prepareInvoice($order, [$item->getId() => 10]); $invoice->register(); $invoice->save(); +$order->save(); + +$invoice = $objectManager->get(\Magento\Sales\Api\InvoiceRepositoryInterface::class)->get($invoice->getId()); /** @var \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory */ $creditmemoFactory = $objectManager->get(\Magento\Sales\Model\Order\CreditmemoFactory::class);