mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
show discount rate on pricing page
This commit is contained in:
parent
631e84f5d6
commit
b1c0dfb0e4
2 changed files with 7 additions and 1 deletions
|
@ -41,7 +41,9 @@ block content
|
|||
hr.thin
|
||||
.row
|
||||
.col-md-12.text-center
|
||||
div(ng-if="trialLength") !{translate("first_few_days_free", {trialLen:'{{trialLength}}'})}
|
||||
div(ng-if="trialLength")
|
||||
span !{translate("first_few_days_free", {trialLen:'{{trialLength}}'})}
|
||||
span(ng-if="discountMonths && discountRate") - {{discountMonths}} #{translate("month")}s {{discountRate}}% Off
|
||||
div(ng-if="price")
|
||||
strong {{price.currency.symbol}}{{price.next.total}}
|
||||
span(ng-if="monthlyBilling") #{translate("every")} #{translate("month")}
|
||||
|
|
|
@ -58,6 +58,10 @@ define [
|
|||
if pricing.items?.coupon?.discount?.type == "percent"
|
||||
basePrice = parseInt(pricing.price.base.plan.unit)
|
||||
$scope.normalPrice = basePrice
|
||||
if pricing.items.coupon.applies_for_months > 0 and pricing.items.coupon?.discount?.rate and pricing.items.coupon?.applies_for_months?
|
||||
$scope.discountMonths = pricing.items.coupon?.applies_for_months
|
||||
$scope.discountRate = pricing.items.coupon?.discount?.rate * 100
|
||||
|
||||
if pricing.price?.taxes[0]?.rate?
|
||||
$scope.normalPrice += (basePrice * pricing.price.taxes[0].rate)
|
||||
$scope.$apply()
|
||||
|
|
Loading…
Reference in a new issue