summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-19 09:09:02 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-19 09:09:02 +0700
commit61afbe62fb03b94263d2e94b2b4b8ada7e60b6f7 (patch)
treede35b99cdf934efd2e371b2ef48351559c4ed9eb /indoteknik_custom/models
parent78f8aeafd40befa56c96f2892012a4a822684265 (diff)
parent34baf6dc9d7031fdfa196446ef4274fff03d0abc (diff)
Merge branch 'cr/minor-fix' into production
Diffstat (limited to 'indoteknik_custom/models')
-rw-r--r--indoteknik_custom/models/website_user_cart.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index 47a695fe..2721d66f 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -55,11 +55,15 @@ class WebsiteUserCart(models.Model):
def get_product_by_user(self, user_id, selected=False, source=False):
user_id = int(user_id)
- source = source if source else 'add_to_cart'
+
+ if source == 'buy':
+ source = ['buy']
+ else:
+ source = ['add_to_cart', 'buy']
parameters = [
('user_id', '=', user_id),
- ('source', '=', source)
+ ('source', 'in', source)
]
if selected: