summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-11-22 10:37:22 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-11-22 10:37:22 +0700
commit395cb850ae364b36764e9d5e0ee0ff8226916696 (patch)
treeb1e2f47cc3762c1bff43bd7e8a2eeed3b23b712b
parent866a2f8dfc5b6628a5ddc5ed88de2a0586ba4761 (diff)
Add product rating from sold amount
-rwxr-xr-xindoteknik_custom/models/product_template.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index d1de2221..264d0bbb 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -120,6 +120,8 @@ class ProductTemplate(models.Model):
rate = 0
if product.web_price:
rate += 4
+ if product.qty_sold > 0:
+ rate += 3
if product.have_promotion_program: #have discount from pricelist
rate += 5
if product.image_128: