diff --git a/ghost/portal/src/components/common/ProductsSection.js b/ghost/portal/src/components/common/ProductsSection.js index 6c3b313b10..f57e550fd4 100644 --- a/ghost/portal/src/components/common/ProductsSection.js +++ b/ghost/portal/src/components/common/ProductsSection.js @@ -531,6 +531,7 @@ function ProductCardPrice({product}) { const {selectedInterval} = useContext(ProductsContext); const monthlyPrice = product.monthlyPrice; const yearlyPrice = product.yearlyPrice; + const trialDays = product.trial_days; const activePrice = selectedInterval === 'month' ? monthlyPrice : yearlyPrice; const alternatePrice = selectedInterval === 'month' ? yearlyPrice : monthlyPrice; if (!monthlyPrice || !yearlyPrice) { @@ -540,6 +541,21 @@ function ProductCardPrice({product}) { const yearlyDiscount = calculateDiscount(product.monthlyPrice.amount, product.yearlyPrice.amount); const currencySymbol = getCurrencySymbol(activePrice.currency); + if (trialDays) { + return ( + <> +
+
+ {trialDays} days free +
+ {(selectedInterval === 'year' ? : '')} + +
+ Then {currencySymbol}{formatNumber(getStripeAmount(activePrice.amount))}/{activePrice.interval} + + ); + } + return (
@@ -550,15 +566,6 @@ function ProductCardPrice({product}) { {(selectedInterval === 'year' ? : '')}
- // Static HTML template for variant of product card for tiers with free trial enabled - //
- //
- // 30 days free - //
- // {(selectedInterval === 'year' ? : '')} - // - //
- // Then $30/month ); }