Changed direct accesses to verifyStok by calls to checkAvailableStock
This commit is contained in:
@@ -141,7 +141,7 @@ class CartAdd extends BaseForm
|
|||||||
->filterByProductId($data["product"])
|
->filterByProductId($data["product"])
|
||||||
->findOne();
|
->findOne();
|
||||||
|
|
||||||
if ($productSaleElements->getQuantity() < $value && ConfigQuery::read("verifyStock", 1) == 1) {
|
if ($productSaleElements->getQuantity() < $value && ConfigQuery::checkAvailableStock()) {
|
||||||
$context->addViolation("quantity value is not valid");
|
$context->addViolation("quantity value is not valid");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ class Cart extends BaseCart
|
|||||||
if ($product &&
|
if ($product &&
|
||||||
$productSaleElements &&
|
$productSaleElements &&
|
||||||
$product->getVisible() == 1 &&
|
$product->getVisible() == 1 &&
|
||||||
($productSaleElements->getQuantity() > $cartItem->getQuantity() || ! ConfigQuery::read("verifyStock", 1)))
|
($productSaleElements->getQuantity() > $cartItem->getQuantity() || ! ConfigQuery::checkAvailableStock()))
|
||||||
{
|
{
|
||||||
|
|
||||||
$item = new CartItem();
|
$item = new CartItem();
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ class CartItem extends BaseCartItem
|
|||||||
$value = $currentQuantity;
|
$value = $currentQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ConfigQuery::read("verifyStock", 1) == 1)
|
if(ConfigQuery::checkAvailableStock())
|
||||||
{
|
{
|
||||||
$productSaleElements = $this->getProductSaleElements();
|
$productSaleElements = $this->getProductSaleElements();
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ class CartItem extends BaseCartItem
|
|||||||
$value = $currentQuantity;
|
$value = $currentQuantity;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(ConfigQuery::read("verifyStock", 1) == 1)
|
if(ConfigQuery::checkAvailableStock())
|
||||||
{
|
{
|
||||||
$productSaleElements = $this->getProductSaleElements();
|
$productSaleElements = $this->getProductSaleElements();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user