summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-02-12 16:37:46 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-02-12 16:37:46 +0700
commitfb5ef1ffd3a52997044a4bcd1f6bef8cc70861ff (patch)
tree6b12f0345e45c772943f2c59822c37802662b22a
parent0060d2789962593280e91d8ea4251a7c18d6115c (diff)
bug fix discount zero in flash sale
-rw-r--r--indoteknik_api/models/product_product.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index bd6f516d..3ecad627 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -287,7 +287,8 @@ class ProductProduct(models.Model):
elif item.fixed_price > 0:
price_flashsale = item.fixed_price # ask darren for include or exclude
price_flashsale = price_flashsale + (price_flashsale * default_tax / 100)
- discount = (base_price - price_flashsale) // base_price * 100
+ discount = (base_price - price_flashsale) * 100 / base_price
+ discount = (math.ceil(discount*100)/100)
price_flashsale = item.fixed_price
# price_flashsale = price_flashsale / default_divide_tax # darren must fill the fixed price with price exclude