From a352d59f03d63bb59fb00dbdf95a71d757d6d033 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Tue, 27 Jun 2017 10:08:05 +0200 Subject: [PATCH] Override update --- www/override/controllers/front/CartController.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/www/override/controllers/front/CartController.php b/www/override/controllers/front/CartController.php index f9457a11..83eea2bb 100644 --- a/www/override/controllers/front/CartController.php +++ b/www/override/controllers/front/CartController.php @@ -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,