Skip to content

Commit

Permalink
OP-282 - fix tests, update command handler
Browse files Browse the repository at this point in the history
  • Loading branch information
SzymonKostrubiec authored and SzymonKostrubiec committed Jul 2, 2024
1 parent 1bcf35c commit 3a5a38f
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/CommandHandler/Wishlist/AddSelectedProductsToCartHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,13 +79,11 @@ private function productIsStockSufficient(OrderItemInterface $product): bool
return false;
}

if (null !== $this->availabilityChecker &&
$this->availabilityChecker->isStockSufficient($variant, $product->getQuantity())
) {
return true;
}

if ($variant->isInStock()) {
if (null !== $this->availabilityChecker) {
if ($this->availabilityChecker->isStockSufficient($variant, $product->getQuantity())) {
return true;
}
} elseif ($variant->isInStock()) {
return true;
}

Expand Down

0 comments on commit 3a5a38f

Please sign in to comment.