summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-07-27 14:27:25 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-07-27 14:27:25 +0700
commit9f842a12e4875039622ac3140495b773cc39da5e (patch)
treea9ec0ff5f8acda846db0afd729337b7fb377238a
parentdf7bbe715bb49d9986d68046127410340b617713 (diff)
Update calculate rating product function on product_template
-rwxr-xr-xindoteknik_custom/models/product_template.py13
1 files changed, 1 insertions, 12 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 933c4676..e48136fa 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -181,18 +181,7 @@ class ProductTemplate(models.Model):
for product in products:
_logger.info("Calculate Rating Product %s" % product.id)
- rate = 0
- if product.web_price:
- rate += 1
- if product.have_promotion_program:
- rate += 1
- if product.image_128:
- rate += 5
- if product.website_description:
- rate += 1
- if product.product_variant_id.qty_stock_vendor > 0:
- rate += 1
- product.product_rating = rate
+ product.product_rating = product.virtual_rating
product.last_calculate_rating = current_time_str
def _get_stock_website(self):