diff options
Diffstat (limited to 'indoteknik_api/models/product_product.py')
| -rw-r--r-- | indoteknik_api/models/product_product.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index 49ea7804..14fe68cb 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -54,6 +54,13 @@ class ProductProduct(models.Model): if price[discount_key] > 0: discount_percentage = price[discount_key] if price[price_key] > 0: price_discount = price[price_key] + flashsale = product_product._get_flashsale_price() + flashsale_price = flashsale['flashsale_price'] + flashsale_discount = flashsale['flashsale_discount'] + if flashsale_price > 0 and flashsale_price < price_discount: + price_discount = flashsale_price + discount_percentage = flashsale_discount + product_template = product_product.product_tmpl_id data = { 'id': product_product.id, @@ -139,7 +146,7 @@ class ProductProduct(models.Model): default_divide_tax = float(1.11) price_after_disc = self._get_website_price_after_disc() res = price_after_disc / default_divide_tax - res = math.floor(res) + res = math.ceil(res) return res def _get_website_price_after_disc(self): |
