Skip to content

Commit 21f7a5f

Browse files
authored
Merge pull request #2881 from FromDoppler/feat/new-plan-selection-by-email-implementation
feat(new-plan-selection): implementación de flujos por Envios y selección inicial segura
2 parents d0870f7 + d528526 commit 21f7a5f

9 files changed

Lines changed: 957 additions & 30 deletions

File tree

src/components/BuyProcess/NewPlanSelection/ContactsPlan/index.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ const getFormattedPriceOptions = (value) => ({
2424
const MORE_THAN_100K_OPTION_VALUE = 'more-than-100000';
2525

2626
const getSessionPromocodeApplied = (sessionPlan) => {
27+
const isFreeAccount = Boolean(sessionPlan?.plan?.isFreeAccount);
28+
const planSubscription = Number(sessionPlan?.plan?.planSubscription);
29+
const hasNonMonthlySubscription = !Number.isNaN(planSubscription) && planSubscription !== 1;
30+
31+
// For paid users with non-monthly subscription we should not prepopulate promocode.
32+
if (!isFreeAccount && hasNonMonthlySubscription) {
33+
return null;
34+
}
35+
2736
const promotion = sessionPlan?.plan?.promotion;
2837
const sanitizeCode = (value) =>
2938
value === undefined || value === null ? '' : String(value).trim();
@@ -227,7 +236,7 @@ export const ContactsPlan = InjectAppServices(
227236
const shouldShowLosePromotionWarning =
228237
!isTailoredPlan && isUpgradePlan && isAppliedPromocodeSameAsSaved;
229238
const shouldUseAdvisorCta = isTailoredPlan || shouldShowDowngradeWarning;
230-
const shouldDisablePaymentFrequency = !keepControlsEnabled;
239+
const shouldDisablePaymentFrequency = !isFreeAccount && !keepControlsEnabled;
231240

232241
const stickyDiscountSummary = useMemo(() => {
233242
if (isTailoredPlan) {

0 commit comments

Comments
 (0)