Skip to content

Commit

Permalink
Fix: Handle introductory offer periods longer than billing periods (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
oalagial authored Feb 6, 2025
1 parent 28997a8 commit ee11282
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ export const ItemVariantDropDownPrice: FunctionComponent< {
{ args }
);
// translation example: $1 first month then $2 per year
} else if ( productBillingTermInMonths === 1 && introTerm === 'year' ) {
return translate(
'%(formattedCurrentPrice)s first year then %(formattedPriceBeforeDiscounts)s per month',
{ args }
);
}
return translate(
'%(formattedCurrentPrice)s first month then %(formattedPriceBeforeDiscounts)s per month',
Expand All @@ -146,8 +151,18 @@ export const ItemVariantDropDownPrice: FunctionComponent< {
);
// translation example: $1 first 3 months then $2 per 2 years
} else if ( productBillingTermInMonths === 12 ) {
return introTerm === 'month'
? translate(
'%(formattedCurrentPrice)s first %(introCount)s months then %(formattedPriceBeforeDiscounts)s per year',
{ args }
)
: translate(
'%(formattedCurrentPrice)s first %(introCount)s years then %(formattedPriceBeforeDiscounts)s per year',
{ args }
);
} else if ( productBillingTermInMonths === 1 && introTerm === 'year' ) {
return translate(
'%(formattedCurrentPrice)s first %(introCount)s months then %(formattedPriceBeforeDiscounts)s per year',
'%(formattedCurrentPrice)s first %(introCount)s years then %(formattedPriceBeforeDiscounts)s per month',
{ args }
);
// translation example: $1 first 3 months then $2 per year
Expand Down

0 comments on commit ee11282

Please sign in to comment.