From 9b99c7766d909a3fd3fcafa71665dbcb285bfd36 Mon Sep 17 00:00:00 2001 From: andrewwallacespeckle Date: Fri, 14 Mar 2025 14:37:44 +0000 Subject: [PATCH] fix(fe): show discounted monthly price when annual plan selected --- .../settings/workspaces/billing/PricingTable/Plan.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue b/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue index ed41b0135..72e6528a2 100644 --- a/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue +++ b/packages/frontend-2/components/settings/workspaces/billing/PricingTable/Plan.vue @@ -13,7 +13,7 @@

- {{ formatPrice(planPrice?.[Roles.Workspace.Member]) }} + {{ formatPrice(finalPlanPrice) }} per seat/month

@@ -141,6 +141,15 @@ const planPrice = computed( prices.value?.[props.plan]?.[props.yearlyIntervalSelected ? 'yearly' : 'monthly'] ) +const finalPlanPrice = computed(() => { + const basePrice = prices.value?.[props.plan].monthly?.['workspace:member'] + if (!basePrice) return undefined + return { + ...basePrice, + amount: props.yearlyIntervalSelected ? basePrice.amount * 0.8 : basePrice.amount + } +}) + const hasCta = computed(() => !!slots.cta) const canUpgradeToPlan = computed(() => { if (!props.currentPlan) return false