Просмотр исходного кода

show normal price if there is a discount

Henry Oswald 11 лет назад
Родитель
Сommit
d959a51f36

+ 2 - 0
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")

+ 6 - 1
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 = ->