Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions classes/models/LengowCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public function updateQty(
if (!empty($idProductAttribute)) {
$version = defined('_PS_VERSION_') ? _PS_VERSION_ : '';
// for PrestaShop 8.0 and higher
if (version_compare($version, '8.0.0.0', '>=')) {
if (version_compare($version, '8.0.0.0', '>=') && !isset($skipAvailabilityCheckOutOfStock)) {
$minimalQuantity = (int) ProductAttribute::getAttributeMinimalQty($idProductAttribute);
} else {
$minimalQuantity = (int) Attribute::getAttributeMinimalQty($idProductAttribute);
Expand All @@ -156,9 +156,7 @@ public function updateQty(
if (isset(self::$_totalWeight[$this->id])) {
unset(self::$_totalWeight[$this->id]);
}
if ((!$product->available_for_order && !$this->forceProduct)
|| (Configuration::get('PS_CATALOG_MODE') && !defined('_PS_ADMIN_DIR_'))
) {
if (!$product->available_for_order && !$this->forceProduct) {
return false;
}
// check if the product is already in the cart
Expand All @@ -185,7 +183,8 @@ public function updateQty(
$qty = '+ ' . (int) $quantity;
// force here
if ($newQty > $productQty
&& !Product::isAvailableWhenOutOfStock(!$this->forceProduct && (int) $result2['out_of_stock'])
&& !$this->forceProduct
&& !Product::isAvailableWhenOutOfStock((int) $result2['out_of_stock'])
) {
return false;
}
Expand Down Expand Up @@ -322,4 +321,4 @@ public function validateFieldLengow($fieldName, $errorType)
$this->{$fieldName} = Context::getContext()->language->id;
}
}
}
}
Loading