diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-27 09:14:34 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-27 09:14:34 +0700 |
| commit | ac4f111ba1605fe3891582b7fc396e740130791d (patch) | |
| tree | d204380870d16a3e523df07b8ba0f907c0184904 /indoteknik_api/controllers/api_v1 | |
| parent | 391fe72c5d9d92d49a09fc971a6c86a39a6e22d1 (diff) | |
| parent | db98ba79a92ca11df958cce513bc320110764434 (diff) | |
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
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) |
