summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2023-10-19 16:03:57 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2023-10-19 16:03:57 +0700
commit1e08cea66f4b4b3e4664f09986b1e41d0ba57830 (patch)
treea13e711e10891cba7f66ca74438fa9b9374f014e
parent1292cb9fc57d972dec21a13df874099cf6d8bef2 (diff)
Add rounding total weight on get user checkout
-rw-r--r--indoteknik_custom/models/website_user_cart.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/indoteknik_custom/models/website_user_cart.py b/indoteknik_custom/models/website_user_cart.py
index 2721d66f..bbc14c88 100644
--- a/indoteknik_custom/models/website_user_cart.py
+++ b/indoteknik_custom/models/website_user_cart.py
@@ -95,6 +95,7 @@ class WebsiteUserCart(models.Model):
tax = round(subtotal * 0.11)
grand_total = subtotal + tax
total_weight = sum(x['weight'] * x['quantity'] for x in products)
+ total_weight = round(total_weight, 2)
result = {
'total_purchase': total_purchase,
'total_discount': total_discount,