diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-04 09:07:18 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-10-04 09:07:18 +0700 |
| commit | d58dbe6fb235570d1b9ca0824556847baea108ef (patch) | |
| tree | acfb7dc70148f79edc6e226266e2ec61a3d717ed | |
| parent | 49c16dcc5209642b7d5aa44eeefb859224e70964 (diff) | |
Fixing calculate website price on product
| -rw-r--r-- | indoteknik_api/models/product_product.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/indoteknik_api/models/product_product.py b/indoteknik_api/models/product_product.py index 559ad35c..e3de8f86 100644 --- a/indoteknik_api/models/product_product.py +++ b/indoteknik_api/models/product_product.py @@ -64,22 +64,22 @@ class ProductProduct(models.Model): price_tier = pricelist.get_tier_level() price_tier = price_tier if price_tier else default_price_tier - price = self._get_pricelist_tier(price_tier) + pricelist = self._get_pricelist_tier(price_tier) discount_key = f'discount_tier{price_tier}' price_key = f'price_tier{price_tier}' - - discount_percentage = price.get(discount_key, 0) - price_discount = price.get(price_key, 0) - + + price = self._v2_get_website_price_exclude_tax() + discount_percentage = pricelist.get(discount_key, 0) + price_discount = pricelist.get(price_key, 0) + flashsale = self._get_flashsale_price() flashsale_price = flashsale.get('flashsale_price', 0) flashsale_discount = flashsale.get('flashsale_discount', 0) if flashsale_price > 0 and flashsale_price < price_discount: price_discount = flashsale_price discount_percentage = flashsale_discount - - price = self._get_website_price_exclude_tax() + return { 'price': price, 'discount_percentage': discount_percentage, |
