Просмотр исходного кода

update the view based on the variants

GitOrigin-RevId: 8aa833bb8d7faeabc25e2497821d5b74c16d3c2a
Rebeka 3 лет назад
Родитель
Сommit
34aec8f8be

+ 18 - 1
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')