// Fix out of stock on combinations with no quantity (thank you Brice <3)

This commit is contained in:
rMalie
2012-05-30 13:48:23 +00:00
parent acdf119988
commit 03864bc2f3
3 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -223,14 +223,14 @@ class CartControllerCore extends FrontController
if (!$this->errors)
{
$cart_rules = $this->context->cart->getCartRules();
$updateQuantity = $this->context->cart->updateQty($this->qty, $this->id_product, $this->id_product_attribute, $this->customization_id, Tools::getValue('op', 'up'), $this->id_address_delivery);
if ($updateQuantity < 0)
$update_quantity = $this->context->cart->updateQty($this->qty, $this->id_product, $this->id_product_attribute, $this->customization_id, Tools::getValue('op', 'up'), $this->id_address_delivery);
if ($update_quantity < 0)
{
// If product has attribute, minimal quantity is set with minimal quantity of attribute
$minimal_quantity = ($this->id_product_attribute) ? Attribute::getAttributeMinimalQty($this->id_product_attribute) : $product->minimal_quantity;
$this->errors[] = sprintf(Tools::displayError('You must add %d minimum quantity', false), $minimal_quantity);
}
elseif (!$updateQuantity)
elseif (!$update_quantity)
$this->errors[] = Tools::displayError('You already have the maximum quantity available for this product.', false);
elseif ((int)Tools::getValue('allow_refresh'))
{