Skip to content

Commit f5132d5

Browse files
committed
ACP2E-3885: is_available attribute in CartItemInterface returns false even when salable stock is high
1 parent 4f0d43f commit f5132d5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

app/code/Magento/QuoteGraphQl/Model/CartItem/ProductStock.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,12 @@ private function isStockQtyAvailable(
165165
float $requiredQuantity,
166166
float $prevQty
167167
): bool {
168-
$storeId = $this->storeManager->getStore()->getId();
169-
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
170-
$scopeId = $websiteId ?? $this->stockConfiguration->getDefaultScopeId();
168+
try {
169+
$storeId = $this->storeManager->getStore()->getId();
170+
$scopeId = $this->storeManager->getStore($storeId)->getWebsiteId();
171+
} catch (NoSuchEntityException $e) {
172+
$scopeId = $this->stockConfiguration->getDefaultScopeId();
173+
}
171174
$stockStatus = $this->stockState->checkQuoteItemQty(
172175
$product->getId(),
173176
$itemQty,

0 commit comments

Comments
 (0)