From d959a51f36d474bdc8660d90f54fb361e8bfa658 Mon Sep 17 00:00:00 2001 From: Henry Oswald Date: Tue, 17 Nov 2015 11:42:03 +0000 Subject: [PATCH] show normal price if there is a discount --- services/web/app/views/subscriptions/new.jade | 2 ++ services/web/public/coffee/main/new-subscription.coffee | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/services/web/app/views/subscriptions/new.jade b/services/web/app/views/subscriptions/new.jade index 2df9637374..b16cfaf44c 100644 --- a/services/web/app/views/subscriptions/new.jade +++ b/services/web/app/views/subscriptions/new.jade @@ -46,6 +46,8 @@ block content strong {{price.currency.symbol}}{{price.next.total}} span(ng-if="monthlyBilling") #{translate("every")} #{translate("month")} span(ng-if="!monthlyBilling") #{translate("every")} #{translate("year")} + div(ng-if="normalPrice") + span.small Normally {{price.currency.symbol}}{{normalPrice}} .row .col-md-12 form(ng-show="planName") diff --git a/services/web/public/coffee/main/new-subscription.coffee b/services/web/public/coffee/main/new-subscription.coffee index 02bb33c7f7..88196b2a37 100644 --- a/services/web/public/coffee/main/new-subscription.coffee +++ b/services/web/public/coffee/main/new-subscription.coffee @@ -29,7 +29,7 @@ define [ country:window.countryCode coupon: window.couponCode - + $scope.validation = correctCardNumber : true correctExpiry: true @@ -55,6 +55,11 @@ define [ $scope.price = pricing.price $scope.trialLength = pricing.items.plan.trial?.length $scope.monthlyBilling = pricing.items.plan.period.length == 1 + if pricing.items?.coupon?.discount?.type == "percent" + basePrice = parseInt(pricing.price.base.plan.unit) + $scope.normalPrice = basePrice + if pricing.price?.taxes[0]?.rate? + $scope.normalPrice += (basePrice * pricing.price.taxes[0].rate) $scope.$apply() $scope.applyCoupon = ->