Allow customers to change to a different product variation (#1719)

This commit is contained in:
Raphael Michel
2020-07-20 16:36:24 +02:00
committed by GitHub
parent c8ef825de5
commit e7b9c49620
17 changed files with 952 additions and 132 deletions

View File

@@ -925,6 +925,46 @@ DEFAULTS = {
"multiple event dates, the earliest date will be used."),
)
},
'change_allow_user_variation': {
'default': 'False',
'type': bool,
'form_class': forms.BooleanField,
'serializer_class': serializers.BooleanField,
'form_kwargs': dict(
label=_("Customers can change the variation of the products they purchased"),
)
},
'change_allow_user_price': {
'default': 'gt',
'type': str,
'form_class': forms.ChoiceField,
'serializer_class': serializers.ChoiceField,
'serializer_kwargs': dict(
choices=(
('gt', _('Only allow changes if the resulting price is higher or equal than the previous price.')),
('eq', _('Only allow changes if the resulting price is equal to the previous price.')),
('any', _('Allow changes regardless of price, even if this results in a refund.')),
)
),
'form_kwargs': dict(
label=_("Requirement for changed prices"),
choices=(
('gt', _('Only allow changes if the resulting price is higher or equal than the previous price.')),
('eq', _('Only allow changes if the resulting price is equal to the previous price.')),
('any', _('Allow changes regardless of price, even if this results in a refund.')),
),
widget=forms.RadioSelect,
),
},
'change_allow_user_until': {
'default': None,
'type': RelativeDateWrapper,
'form_class': RelativeDateTimeField,
'serializer_class': SerializerRelativeDateTimeField,
'form_kwargs': dict(
label=_("Do not allow changes after"),
)
},
'cancel_allow_user': {
'default': 'True',
'type': bool,