diff options
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/cart.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_api/controllers/api_v1/cart.py b/indoteknik_api/controllers/api_v1/cart.py index 5948a277..f472a9b0 100644 --- a/indoteknik_api/controllers/api_v1/cart.py +++ b/indoteknik_api/controllers/api_v1/cart.py @@ -44,6 +44,7 @@ class Cart(controller.Controller): qty = int(kw.get('qty', 0)) source = kw.get('source') + qty_append = kw.get('qty_append', False) is_selected = kw.get('selected', False) is_selected = is_selected in ('true', True) @@ -78,6 +79,9 @@ class Cart(controller.Controller): 'product_id': product_id, 'source': source or False } + + if isinstance(qty_append, str) and qty_append.lower() == "true" and cart: + data_to_update['qty'] += cart.qty if cart: cart.write(data_to_update) |
