mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-08 19:50:47 +00:00
show normal price if there is a discount
This commit is contained in:
parent
fefe7c2022
commit
d959a51f36
2 changed files with 8 additions and 1 deletions
|
@ -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")
|
||||
|
|
|
@ -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 = ->
|
||||
|
|
Loading…
Add table
Reference in a new issue