Merge pull request #35836 from overleaf/rh-prices-split

[web] Update monthly plan prices for new subscriptions with split test

GitOrigin-RevId: 42d0adaf68647adc93f4c05d5ddeefb356753db2
This commit is contained in:
roo hutton
2026-09-17 11:49:04 +00:00
committed by Copybot
parent 2e1a313ccd
commit b886c0b266
18 changed files with 553 additions and 30 deletions
@@ -21,6 +21,7 @@ import {
import { Institution } from '../../../../../types/institution'
import getMeta from '../../../utils/meta'
import {
formatPriceForDisplayData,
loadDisplayPriceWithTaxPromise,
loadGroupDisplayPriceWithTaxForRecurlyPromise,
loadGroupDisplayPriceWithTaxForStripePromise,
@@ -173,15 +174,25 @@ export function SubscriptionDashboardProvider({
personalSubscription?.payment
) {
const { currency, taxRate } = personalSubscription.payment
// Only Stripe subscriptions can be derived from the price version. Recurly only has one version of each price.
const isStripe = Boolean(personalSubscription.service?.includes('stripe'))
const fetchPlansDisplayPrices = async () => {
for (const plan of plansWithoutDisplayPrice) {
try {
const priceData = await loadDisplayPriceWithTaxPromise(
plan.planCode,
currency,
taxRate,
i18n.language
)
const priceData =
isStripe && plan.listPrice !== undefined
? formatPriceForDisplayData(
plan.listPrice,
taxRate,
currency,
i18n.language
)
: await loadDisplayPriceWithTaxPromise(
plan.planCode,
currency,
taxRate,
i18n.language
)
if (priceData?.totalAsNumber !== undefined) {
plan.displayPrice = formatCurrency(
priceData.totalAsNumber,
@@ -28,12 +28,12 @@ function queryRecurlyPlanPrice(planCode: string, currency: CurrencyCode) {
}
export function formatPriceForDisplayData(
price: string,
price: string | number,
taxRate: number,
currencyCode: CurrencyCode,
locale: string
): PriceForDisplayData {
const totalPriceExTax = parseFloat(price)
const totalPriceExTax = typeof price === 'number' ? price : parseFloat(price)
let taxAmount = totalPriceExTax * taxRate
if (isNaN(taxAmount)) {
taxAmount = 0
@@ -169,7 +169,8 @@
&[data-ol-student-mode='true'] {
.plans-new-group-member-picker,
.plans-educational-discount {
.plans-educational-discount,
.hide-for-plan-type-student {
display: none;
}