diff --git a/core/lib/Thelia/Form/CartAdd.php b/core/lib/Thelia/Form/CartAdd.php index 59d13765d..98e12acde 100755 --- a/core/lib/Thelia/Form/CartAdd.php +++ b/core/lib/Thelia/Form/CartAdd.php @@ -141,7 +141,7 @@ class CartAdd extends BaseForm ->filterByProductId($data["product"]) ->findOne(); - if ($productSaleElements->getQuantity() < $value && ConfigQuery::read("verifyStock", 1) == 1) { + if ($productSaleElements->getQuantity() < $value && ConfigQuery::checkAvailableStock()) { $context->addViolation("quantity value is not valid"); } } diff --git a/core/lib/Thelia/Model/Cart.php b/core/lib/Thelia/Model/Cart.php index 36b604258..c1f28bc3d 100755 --- a/core/lib/Thelia/Model/Cart.php +++ b/core/lib/Thelia/Model/Cart.php @@ -36,7 +36,7 @@ class Cart extends BaseCart if ($product && $productSaleElements && $product->getVisible() == 1 && - ($productSaleElements->getQuantity() > $cartItem->getQuantity() || ! ConfigQuery::read("verifyStock", 1))) + ($productSaleElements->getQuantity() > $cartItem->getQuantity() || ! ConfigQuery::checkAvailableStock())) { $item = new CartItem(); diff --git a/core/lib/Thelia/Model/CartItem.php b/core/lib/Thelia/Model/CartItem.php index 5432bd1ab..ef72c070c 100755 --- a/core/lib/Thelia/Model/CartItem.php +++ b/core/lib/Thelia/Model/CartItem.php @@ -51,7 +51,7 @@ class CartItem extends BaseCartItem $value = $currentQuantity; } - if(ConfigQuery::read("verifyStock", 1) == 1) + if(ConfigQuery::checkAvailableStock()) { $productSaleElements = $this->getProductSaleElements(); @@ -75,7 +75,7 @@ class CartItem extends BaseCartItem $value = $currentQuantity; } - if(ConfigQuery::read("verifyStock", 1) == 1) + if(ConfigQuery::checkAvailableStock()) { $productSaleElements = $this->getProductSaleElements();