Update ProductPaymentForm for yearly subscription

This commit is contained in:
PCoder 2019-11-15 19:45:35 +05:30
parent f0b604c6dc
commit 3bf2654b50

View file

@ -109,9 +109,14 @@ class ProductPaymentForm(GenericPaymentForm):
)
)
if self.product.product_is_subscription:
payment_type = "month"
if self.product.product_subscription_interval == "month":
payment_type = _('Monthly subscription')
elif self.product.product_subscription_interval == "year":
payment_type = _('Yearly subscription')
self.fields['amount'].label = "{amt} ({payment_type})".format(
amt=_('Amount in CHF'),
payment_type=_('Monthly subscription')
payment_type=payment_type
)
else:
self.fields['amount'].label = "{amt} ({payment_type})".format(