Skip to content
Draft
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: 3 additions & 8 deletions classes/models/LengowCart.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,8 @@ public function updateQty(
}
// if we have a product combination, the minimal quantity is set with the one of this combination
if (!empty($idProductAttribute)) {
$version = defined('_PS_VERSION_') ? _PS_VERSION_ : '';
// for PrestaShop 8.0 and higher
if (version_compare($version, '8.0.0.0', '>=') && !isset($skipAvailabilityCheckOutOfStock)) {
$minimalQuantity = (int) ProductAttribute::getAttributeMinimalQty($idProductAttribute);
} else {
$minimalQuantity = (int) Attribute::getAttributeMinimalQty($idProductAttribute);
}
$combination = new Combination((int) $idProductAttribute);
$minimalQuantity = (int) $combination->minimal_quantity;
} else {
$minimalQuantity = (int) $product->minimal_quantity;
}
Expand Down Expand Up @@ -321,4 +316,4 @@ public function validateFieldLengow($fieldName, $errorType)
$this->{$fieldName} = Context::getContext()->language->id;
}
}
}
}