[-] BO: Add feedback on backoffice order when the minimal quantity is not reached
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15693 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
1 parent
7faa0b74b1
commit
c9e28d8bf6
1 file changed
+5
@@ -340,6 +340,11 @@ class AdminCartsControllerCore extends AdminController
|
|||||||
|
|
||||||
if (!($qty_upd = $this->context->cart->updateQty($qty, $id_product, (int)$id_product_attribute, (int)$id_customization, $operator)))
|
if (!($qty_upd = $this->context->cart->updateQty($qty, $id_product, (int)$id_product_attribute, (int)$id_customization, $operator)))
|
||||||
$errors[] = Tools::displayError('You already have the maximum quantity available for this product.');
|
$errors[] = Tools::displayError('You already have the maximum quantity available for this product.');
|
||||||
|
elseif ($qty_upd < 0)
|
||||||
|
{
|
||||||
|
$minimal_qty = $id_product_attribute ? Attribute::getAttributeMinimalQty((int)$id_product_attribute) : $product->minimal_quantity;
|
||||||
|
$errors[] = sprintf(Tools::displayError('You must add a minimum of %d quantity', false), $minimal_qty);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
echo Tools::jsonEncode(array_merge($this->ajaxReturnVars(), array('errors' => $errors)));
|
echo Tools::jsonEncode(array_merge($this->ajaxReturnVars(), array('errors' => $errors)));
|
||||||
|
|||||||
Reference in new issue
Block a user