diff --git a/classes/models/LengowCart.php b/classes/models/LengowCart.php index 0382e74f..1d5edae1 100755 --- a/classes/models/LengowCart.php +++ b/classes/models/LengowCart.php @@ -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; } @@ -321,4 +316,4 @@ public function validateFieldLengow($fieldName, $errorType) $this->{$fieldName} = Context::getContext()->language->id; } } -} +}