Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Turn off price test #1482

Merged
merged 6 commits into from Feb 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 3 additions & 5 deletions frontend/app/controllers/Joiner.scala
Expand Up @@ -29,7 +29,7 @@ import services.PromoSessionService.codeFromSession
import services.{GuardianContentService, _}
import tracking.ActivityTracking
import utils.RequestCountry._
import utils.TestUsers.{NameEnteredInForm, PreSigninTestCookie}
import utils.TestUsers.PreSigninTestCookie
import utils.{CampaignCode, TierChangeCookies}
import views.support
import views.support.MembershipCompat._
Expand Down Expand Up @@ -115,7 +115,6 @@ object Joiner extends Controller with ActivityTracking
tier: PaidTier,
countryGroup: CountryGroup,
promoCode: Option[PromoCode],
pricingType: Option[BillingPeriod],
paypalTest: Boolean = false) = NonMemberAction(tier).async { implicit request =>

implicit val resolution: TouchpointBackend.Resolution =
Expand All @@ -138,13 +137,13 @@ object Joiner extends Controller with ActivityTracking
val pageInfo = PageInfo(
stripePublicKey = Some(stripeService.publicKey),
payPalEnvironment = Some(tpBackend.payPalService.config.payPalEnvironment),
initialCheckoutForm = CheckoutForm.forIdentityUser(identityUser, plans, Some(countryGroup), pricingType)
initialCheckoutForm = CheckoutForm.forIdentityUser(identityUser, plans, Some(countryGroup))
)

val providedPromoCode = promoCode orElse codeFromSession

// is the providedPromoCode valid for the page being rendered (year is default billing period)
val planChoice = PaidPlanChoice(tier, pricingType.getOrElse(BillingPeriod.year))
val planChoice = PaidPlanChoice(tier, BillingPeriod.year)
val validPromoCode = providedPromoCode.flatMap(promoService.validate[NewUsers](_, pageInfo.initialCheckoutForm.defaultCountry.get, planChoice.productRatePlanId).toOption)
val validPromotion = validPromoCode.flatMap(validPromo => promoService.findPromotion(validPromo.code))

Expand All @@ -153,7 +152,6 @@ object Joiner extends Controller with ActivityTracking

val countryCurrencyWhitelist = CountryWithCurrency.whitelisted(supportedCurrencies, GBP)


Ok(
if(paypalTest){
views.html.joiner.form.paymentPayPal(
Expand Down
5 changes: 2 additions & 3 deletions frontend/app/views/fragments/page/elevatedButton.scala.html
Expand Up @@ -21,10 +21,9 @@
href="@{routes.Joiner.enterPaidDetails(supporterPlans.tier)}?countryGroup=@countryGroup.id">
<div class="elevated-button__text ">
Become a Supporter <br/>
<span class="elevated-button--pricing-placeholder" style="visibility:hidden">for @pricing.getPhrase(Month())</span>
<span class="elevated-button--pricing-monthly" style="display:none">for @pricing.getPhrase(Month())</span>
<span class="elevated-button--pricing-annual" style="display:none">for @pricing.getPhrase(Year())</span>
<span class="elevated-button--pricing-placeholder">for @pricing.getPhrase(Month())</span>
</div>

<div class="elevated-button__icon">
<div class="elevated-button__icon__border">
@for(icon <- Asset.inlineSvg("arrow-right-button")) {
Expand Down
4 changes: 2 additions & 2 deletions frontend/app/views/support/CheckoutForm.scala
Expand Up @@ -10,7 +10,7 @@ case class CheckoutForm(defaultCountry: Option[Country],
billingPeriod: BillingPeriod)

object CheckoutForm extends LazyLogging {
def forIdentityUser(idUser: IdentityUser, plans: TierPlans, requestCountryGroup: Option[CountryGroup], pricingType : Option[BillingPeriod] = None): CheckoutForm = {
def forIdentityUser(idUser: IdentityUser, plans: TierPlans, requestCountryGroup: Option[CountryGroup]): CheckoutForm = {
val (country, desiredCurrency) = (requestCountryGroup, idUser.country) match {
case (Some(cg), _) =>
(cg.defaultCountry, cg.currency)
Expand All @@ -29,6 +29,6 @@ object CheckoutForm extends LazyLogging {
val currency =
if (plans.currencies.contains(desiredCurrency)) desiredCurrency else GBP

CheckoutForm(country, currency, pricingType.getOrElse(BillingPeriod.year))
CheckoutForm(country, currency, BillingPeriod.year)
}
}
5 changes: 0 additions & 5 deletions frontend/assets/javascripts/src/main.js
Expand Up @@ -26,7 +26,6 @@ require([
'src/modules/patterns',
'src/modules/paidToPaid',
'src/modules/memstatus',
'src/modules/tools/priceABTest',
'src/modules/faq',
'src/modules/landingBundles'
], function(
Expand Down Expand Up @@ -57,7 +56,6 @@ require([
patterns,
paidToPaid,
memstatus,
priceABTest,
faq,
landingBundles
) {
Expand All @@ -66,9 +64,6 @@ require([
ajax.init({page: {ajaxUrl: ''}});
raven.init('https://8ad435f4fefe468eb59b19fd81a06ea9@app.getsentry.com/56405');

//Price ABTest
priceABTest.init();

analytics.init();

// Global
Expand Down
3 changes: 0 additions & 3 deletions frontend/assets/javascripts/src/modules/analytics/ga.es6
Expand Up @@ -101,9 +101,6 @@ export function init() {
wrappedGa('set', dimensions.isLoggedOn, isLoggedIn.toString());
wrappedGa('set', dimensions.signedOut, signedOut.toString());
wrappedGa('set', dimensions.platform, 'membership');
if (guardian.abPriceCTA) {
wrappedGa('set', dimensions.experience, guardian.abPriceCTA);
}

if (isLoggedIn) {
wrappedGa('set', dimensions.identityId, u.id);
Expand Down
62 changes: 0 additions & 62 deletions frontend/assets/javascripts/src/modules/tools/priceABTest.es6

This file was deleted.

2 changes: 1 addition & 1 deletion frontend/conf/routes
Expand Up @@ -20,7 +20,7 @@ GET /analytics-off controllers.Testing.analyt
GET /join/staff controllers.Joiner.staff
GET /join/staff/enter-details controllers.Joiner.enterStaffDetails
GET /join/friend/enter-details controllers.Joiner.enterFriendDetails
GET /join/:tier/enter-details controllers.Joiner.enterPaidDetails(tier: PaidTier, countryGroup: CountryGroup ?= CountryGroup.UK, promoCode: Option[PromoCode] ?= None, pricing: Option[BillingPeriod] ?= None, paypalTest: Boolean ?= false)
GET /join/:tier/enter-details controllers.Joiner.enterPaidDetails(tier: PaidTier, countryGroup: CountryGroup ?= CountryGroup.UK, promoCode: Option[PromoCode] ?= None, paypalTest: Boolean ?= false)
POST /join/friend/enter-details controllers.Joiner.joinFriend
POST /join/staff/enter-details controllers.Joiner.joinStaff
POST /join/:tier/enter-details controllers.Joiner.joinPaid(tier: PaidTier)
Expand Down