Update ProductPaymentForm for yearly subscription
This commit is contained in:
		
					parent
					
						
							
								f0b604c6dc
							
						
					
				
			
			
				commit
				
					
						3bf2654b50
					
				
			
		
					 1 changed files with 6 additions and 1 deletions
				
			
		| 
						 | 
					@ -109,9 +109,14 @@ class ProductPaymentForm(GenericPaymentForm):
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        if self.product.product_is_subscription:
 | 
					        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(
 | 
					            self.fields['amount'].label = "{amt} ({payment_type})".format(
 | 
				
			||||||
                amt=_('Amount in CHF'),
 | 
					                amt=_('Amount in CHF'),
 | 
				
			||||||
                payment_type=_('Monthly subscription')
 | 
					                payment_type=payment_type
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            self.fields['amount'].label = "{amt} ({payment_type})".format(
 | 
					            self.fields['amount'].label = "{amt} ({payment_type})".format(
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue