Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Use checkout.get_subtotal when validating voucher limit

Krzysztof Wolski7e3479103dee
diff --git a/saleor/discount/models.py b/saleor/discount/models.py
index c1d8488b46..339c665099 100644
--- a/saleor/discount/models.py
+++ b/saleor/discount/models.py
@@ -168,7 +168,7 @@ class Voucher(models.Model):
def get_discount_for_checkout(self, checkout):
if self.type == Voucher.VALUE_TYPE:
- cart_total = checkout.cart.get_total()
+ cart_total = checkout.get_subtotal()
self.validate_limit(cart_total)
return self.get_fixed_discount_for(cart_total)
@@ -188,7 +188,7 @@ class Voucher(models.Model):
'voucher', 'This offer is only valid in %(country)s.')
raise NotApplicable(msg % {
'country': self.get_apply_to_display()})
- cart_total = checkout.cart.get_total()
+ cart_total = checkout.get_subtotal()
self.validate_limit(cart_total)
return self.get_fixed_discount_for(shipping_method.price)