mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-06 07:39:02 +02:00
show discount rate on pricing page
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user