Override update

This commit is contained in:
Michael RICOIS 2017-06-27 10:08:05 +02:00
parent 0c49237644
commit a352d59f03

View File

@ -179,10 +179,11 @@ class CartController extends CartControllerCore
break;
}
$this->id_configurator = $cart_product['id_configurator'];
$qty_to_check = $cart_product['cart_quantity'];
// Define configurator
$this->id_configurator = $cart_product['id_configurator'];
if (Tools::getValue('op', 'up') == 'down') {
$qty_to_check -= $this->qty;
} else {
@ -223,7 +224,7 @@ class CartController extends CartControllerCore
$this->errors[] = Tools::displayError('There isn\'t enough product in stock.', !Tools::getValue('ajax'));
}
if (!$this->errors && $mode == 'add') {
if (!$this->errors && $mode == 'add') {
if (!$this->context->cart->id) {
if (Context::getContext()->cookie->id_guest) {
$guest = new Guest(Context::getContext()->cookie->id_guest);
@ -241,9 +242,9 @@ class CartController extends CartControllerCore
if (!$this->errors) {
$cart_rules = $this->context->cart->getCartRules();
$available_cart_rules = CartRule::getCustomerCartRules($this->context->language->id, (isset($this->context->customer->id) ? $this->context->customer->id : 0), true, true, true, $this->context->cart, false, true);
$this->parseConfigurator();
$this->parseConfigurator();
$update_quantity = $this->context->cart->updateQty(
$this->qty,
$this->id_product,