Allow sales channels to opt out of customer accounts

This commit is contained in:
Raphael Michel
2021-09-08 20:32:55 +02:00
parent 9a3b4f7863
commit 7bffd461d1
2 changed files with 8 additions and 1 deletions

View File

@@ -82,6 +82,13 @@ class SalesChannel:
"""
return False
@property
def customer_accounts_supported(self) -> bool:
"""
If this property is ``True``, checkout will show the customer login step.
"""
return True
def get_all_sales_channels():
global _ALL_CHANNELS

View File

@@ -236,7 +236,7 @@ class CustomerStep(CartMixin, TemplateFlowStep):
icon = 'user'
def is_applicable(self, request):
return request.organizer.settings.customer_accounts
return request.organizer.settings.customer_accounts and request.sales_channel.customer_accounts_supported
@cached_property
def login_form(self):