Skip to content

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

Return shipping address as billing if available

Michał Ociepka2f73c1b1dadc
diff --git a/saleor/checkout/core.py b/saleor/checkout/core.py
index 65aaf8f680..aefbf845c3 100644
--- a/saleor/checkout/core.py
+++ b/saleor/checkout/core.py
@@ -118,9 +118,12 @@ class Checkout(object):
@property
def billing_address(self):
address = self._get_address_from_storage('billing_address')
- if address is None and self.user.is_authenticated():
+ if address is not None:
+ return address
+ elif self.user.is_authenticated() and self.user.default_billing_address:
return self.user.default_billing_address
- return address
+ elif self.shipping_address:
+ return self.shipping_address
@billing_address.setter
def billing_address(self, address):