diff --git a/language/functions.xml b/language/functions.xml index 5a8df8d6dc42..1148a25c65f1 100644 --- a/language/functions.xml +++ b/language/functions.xml @@ -1258,13 +1258,7 @@ class Cart public function add($product, $quantity) { - $this->products[$product] = $quantity; - } - - public function getQuantity($product) - { - return isset($this->products[$product]) ? $this->products[$product] : - FALSE; + $this->products[$product] = ($this->products[$product] ?? 0) + $quantity; } public function getTotal($tax)