diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-08-04 06:28:27 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-08-04 06:28:27 +0000 |
| commit | 598b9cb31cf5fc8a6fb67f55175ad14c4ec64765 (patch) | |
| tree | 0361a3c3985990c5d4236338b541d87233826c4b /indoteknik_api/controllers/api_v1 | |
| parent | 1ef822f76b33fdd7db786735c6fd7f770b26f3ee (diff) | |
| parent | b13c2905bbc409ced20b05e693779aba1c8f7768 (diff) | |
Merged in development (pull request #83)
Development
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/voucher.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/voucher.py b/indoteknik_api/controllers/api_v1/voucher.py index f82e1aef..0ecdd20d 100644 --- a/indoteknik_api/controllers/api_v1/voucher.py +++ b/indoteknik_api/controllers/api_v1/voucher.py @@ -12,6 +12,7 @@ class Voucher(controller.Controller): cart = request.env['website.user.cart'] code = kw.get('code') user_id = kw.get('user_id') + source = kw.get('source') visibility = ['public'] parameter = [] @@ -25,7 +26,7 @@ class Voucher(controller.Controller): parameter += [('visibility', 'in', visibility)] vouchers = request.env['voucher'].get_active_voucher(parameter) vouchers = vouchers.res_format() - checkout = cart.get_user_checkout(user_id) + checkout = cart.get_user_checkout(user_id, source=source) for voucher in vouchers: apply_status = '' @@ -58,6 +59,8 @@ class Voucher(controller.Controller): apply_status = 'UM' # Unqualified Manufacture elif subtotal < min_purchase_amount: apply_status = 'MPA' # Minimum Purchase Amount + if has_flashsale_products: + apply_status += '-HF' # Has Flashsale else: can_apply = True |
