From de0542b33c57cd5a4d364c12f68ffa2d2098815f Mon Sep 17 00:00:00 2001 From: Franck Allimant Date: Thu, 5 Dec 2013 13:02:13 +0100 Subject: [PATCH] Changed direct accesses to verifyStok by calls to checkAvailableStock --- core/lib/Thelia/Form/CartAdd.php | 2 +- core/lib/Thelia/Model/Cart.php | 2 +- core/lib/Thelia/Model/CartItem.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) 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();