diff --git a/bp/cart/services/total.py b/bp/cart/services/total.py index 3f9b484..8dcdaf9 100644 --- a/bp/cart/services/total.py +++ b/bp/cart/services/total.py @@ -1,6 +1,12 @@ +from decimal import Decimal + + def total(cart): return sum( - (item.product.special_price or item.product.regular_price) * item.quantity + ( + Decimal(str(item.product.special_price or item.product.regular_price)) + * item.quantity + ) for item in cart if (item.product.special_price or item.product.regular_price) is not None )