Skip to content

Commit

Permalink
Merge pull request #894 from dpfaffenbauer/cart-stock-validation
Browse files Browse the repository at this point in the history
[CoreBundle] fix cart-stock validation
  • Loading branch information
dpfaffenbauer authored Mar 22, 2019
2 parents b14b925 + 366af72 commit e607f84
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function validate($cart, Constraint $constraint): void
private function getExistingCartItemQuantityFromCart(CartInterface $cart, CartItemInterface $cartItem)
{
$product = $cartItem->getProduct();
$quantity = 0;
$quantity = $cartItem->getDefaultUnitQuantity();

/**
* @var CartItemInterface $item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,6 @@ public function modify(StorageListItemInterface $item, int $targetQuantity)
*/
Assert::isInstanceOf($item, CartItemInterface::class);

$currentQuantity = $item->getQuantity();
if (0 >= $targetQuantity || $currentQuantity === $targetQuantity) {
return;
}

$item->setQuantity($targetQuantity);

if ($item->hasUnitDefinition()) {
Expand Down

0 comments on commit e607f84

Please sign in to comment.