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

@ -96,6 +96,10 @@ html(itemscope, itemtype='http://schema.org/Product')
indexName : '!{settings.templates.indexName}'
}
- if (settings.overleaf && settings.overleaf.host)
script.
window.v1BaseUrl = '!{settings.overleaf.host}'
body
if(settings.recaptcha)
script(src="https://www.google.com/recaptcha/api.js?render=explicit")

View file

@ -11,6 +11,9 @@ define [
w = window.open()
go = () ->
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
if window.v1BaseUrl?
url = "#{window.v1BaseUrl}/users/trial"
else
url = "/user/subscription/new?planCode=#{plan}&ssp=true"
if couponCode?
url = "#{url}&cc=#{couponCode}"