summaryrefslogtreecommitdiff
path: root/indoteknik_api
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-03 12:03:55 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-03 12:03:55 +0700
commit49c16dcc5209642b7d5aa44eeefb859224e70964 (patch)
treec1c32aa8fa73463812b25f698aa293e46ce37e3d /indoteknik_api
parent972a7b1e6a4d0ec33f183b7a194f1592fb3c3031 (diff)
Update default price discount to price on calc web price
Diffstat (limited to 'indoteknik_api')
-rw-r--r--indoteknik_api/models/product_product.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py
index b49c419c..559ad35c 100644
--- a/indoteknik_api/models/product_product.py
+++ b/indoteknik_api/models/product_product.py
@@ -79,10 +79,11 @@ class ProductProduct(models.Model):
price_discount = flashsale_price
discount_percentage = flashsale_discount
+ price = self._get_website_price_exclude_tax()
return {
- 'price': self._get_website_price_exclude_tax(),
+ 'price': price,
'discount_percentage': discount_percentage,
- 'price_discount': price_discount
+ 'price_discount': price_discount if price_discount > 0 else price
}
def api_manufacture(self, product_template):