Saleor Core: the high performance, composable, headless commerce API.
Python cartcheckoutcommercecomposablee-commerceecommercegraphqlheadlessheadless-commercemultichannelomsorder-managementpaymentspimpythonshopshopping-cartstore
Add delivery price to total checkout price
Michał Ociepka7a624b0b364a
diff --git a/saleor/checkout/__init__.py b/saleor/checkout/__init__.pyindex 60e8a047ff..dbda3618c6 100644--- a/saleor/checkout/__init__.py+++ b/saleor/checkout/__init__.py@@ -1,5 +1,7 @@from collections import defaultdict+from django.conf import settings+from prices import Pricefrom satchless.process import ProcessManagerfrom .steps import (BillingAddressStep, ShippingStep, DigitalDeliveryStep,@@ -92,7 +94,10 @@ class Checkout(ProcessManager):return self.storage[name]def get_total(self, **kwargs):- return self.items.get_total(**kwargs)+ zero = Price(0, currency=settings.DEFAULT_CURRENCY)+ total = sum((step.group.get_total_with_delivery() for step in self+ if step.group), zero)+ return totaldef save(self):self.request.session[STORAGE_SESSION_KEY] = dict(self.storage)