From 34aec8f8bea2472a6fe715204ff8a997dc33880b Mon Sep 17 00:00:00 2001 From: Rebeka Date: Tue, 8 Aug 2023 16:41:14 +0200 Subject: [PATCH] update the view based on the variants GitOrigin-RevId: 8aa833bb8d7faeabc25e2497821d5b74c16d3c2a --- .../subscription/plans-v2/plans-v2-main.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-main.js b/services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-main.js index e2acdba975..6ef5f1d1d0 100644 --- a/services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-main.js +++ b/services/web/frontend/js/pages/user/subscription/plans-v2/plans-v2-main.js @@ -51,7 +51,24 @@ export function updateLinkTargets() { const plan = el.getAttribute('data-ol-start-new-subscription') const view = el.getAttribute('data-ol-item-view') - const suffix = view === 'annual' ? `-annual` : `_free_trial_7_days` + // annual split test trial (nudge, no-nudge, default) + const annualTrialsVariant = getMeta('ol-splitTestVariants')?.[ + 'annual-trials' + ] + + let suffix = '' + if (view === 'annual') { + if (annualTrialsVariant === 'nudge') { + suffix = '-annual_free_trial_7_days' + } else if (annualTrialsVariant === 'no-nudge') { + suffix = '-annual_free_trial_7_days' + } else if (annualTrialsVariant === 'default') { + suffix = '-annual' + } + } else { + suffix = '_free_trial_7_days' + } + const planCode = `${plan}${suffix}` const location = el.getAttribute('data-ol-location')