show normal price if there is a discount

This commit is contained in:
Henry Oswald 2015-11-17 11:42:03 +00:00
parent fefe7c2022
commit d959a51f36
2 changed files with 8 additions and 1 deletions

View file

@ -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")

View file

@ -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 = ->