Skip to content

Commit

Permalink
Fixing stock issues in cases when stock is disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
alfredsgenkins authored Dec 20, 2019
1 parent 1cb9393 commit 76a156f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Model/Resolver/SaveCartItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ protected function checkItemQty(CartItemInterface $cartItem, $qty): void
$stockStatus = $this->stockStatusRepository->get($product->getId());
$stockItem = $stockStatus->getStockItem();

// return if stock is not managed
if (!$stockItem->getManageStock()) return;

$fitsInStock = $qty <= $stockItem->getQty();
$isInMinMaxSaleRange = $qty >= $stockItem->getMinSaleQty() || $qty <= $stockItem->getMaxSaleQty();

Expand Down

0 comments on commit 76a156f

Please sign in to comment.