From ef235ad1483ca6770f2d6ae581cf9cb631744819 Mon Sep 17 00:00:00 2001 From: Rish Date: Wed, 16 Sep 2020 23:43:19 +0530 Subject: [PATCH] Updated plan update start date no issue - Updates the new plan's start date based on billing interval change - If current and new billing interval is same, plan starts at period end, immediately otherwise --- ghost/portal/src/components/pages/AccountPlanPage.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ghost/portal/src/components/pages/AccountPlanPage.js b/ghost/portal/src/components/pages/AccountPlanPage.js index 971d2f3e89..0de30842aa 100644 --- a/ghost/portal/src/components/pages/AccountPlanPage.js +++ b/ghost/portal/src/components/pages/AccountPlanPage.js @@ -106,6 +106,12 @@ const PlanConfirmationSection = ({action, member, plan, type, brandColor, onConf const subscription = getMemberSubscription({member}); const isRunning = ['updateSubscription:running', 'checkoutPlan:running', 'cancelSubscription:running'].includes(action); const label = 'Confirm'; + let planStartDate = getDateString(subscription.current_period_end); + const currentActivePlan = getMemberActivePlan({member}); + if (currentActivePlan.type !== plan.type) { + planStartDate = 'immediately'; + } + const planStartMessage = `${plan.currency}${plan.price}/${plan.type} – Starting ${planStartDate}`; if (type === 'changePlan') { return (
@@ -119,7 +125,7 @@ const PlanConfirmationSection = ({action, member, plan, type, brandColor, onConf

Price

-

{plan.currency}{plan.price}/{plan.type} – Starting {getDateString(subscription.current_period_end)}

+

{planStartMessage}