When upgrading track changes on V2, redirect to V1 trial page

This commit is contained in:
Alasdair Smith 2017-12-11 18:03:09 +00:00
parent 9fe1f36df4
commit f5c914ed6c
2 changed files with 11 additions and 4 deletions

View file

@ -95,6 +95,10 @@ html(itemscope, itemtype='http://schema.org/Product')
cdnDomain : '!{settings.templates.cdnDomain}',
indexName : '!{settings.templates.indexName}'
}
- if (settings.overleaf && settings.overleaf.host)
script.
window.v1BaseUrl = '!{settings.overleaf.host}'
body
if(settings.recaptcha)

View file

@ -11,9 +11,12 @@ define [
w = window.open()
go = () ->
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
url = "/user/subscription/new?planCode=#{plan}&ssp=true"
if couponCode?
url = "#{url}&cc=#{couponCode}"
if window.v1BaseUrl?
url = "#{window.v1BaseUrl}/users/trial"
else
url = "/user/subscription/new?planCode=#{plan}&ssp=true"
if couponCode?
url = "#{url}&cc=#{couponCode}"
$scope.startedFreeTrial = true
switch source
@ -27,7 +30,7 @@ define [
else
event_tracking.sendMB "subscription-start-trial", { source, plan }
w.location = url
if $scope.shouldABTestPlans