fixQuantity example

if ($available < $minPurchase) {
            $scope->remove($item->getId());

            $cart->addErrors(
                new ProductOutOfStockError((string) $item->getReferencedId()(string) $item->getLabel())
            );

            return;
        }

        if ($available < $item->getQuantity()) {
            $maxAvailable = $this->fixQuantity($minPurchase$available$steps);

            $item->setQuantity($maxAvailable);

            $cart->addErrors(
                new ProductStockReachedError((string) $item->getReferencedId()(string) $item->getLabel()$maxAvailable)
            );

            return;
        }

        if ($item->getQuantity() < $minPurchase) {
            
Home | Imprint | This part of the site doesn't use cookies.