Browse Source

Product price based on currency coefficient

Vova Tkach 5 years ago
parent
commit
012cc70de9
1 changed files with 5 additions and 1 deletions
  1. 5 1
      engine/fetdata/shop_product.go

+ 5 - 1
engine/fetdata/shop_product.go

@@ -134,7 +134,11 @@ func (this *ShopProduct) Price() float64 {
 	if this == nil {
 		return 0
 	}
-	return this.object.A_price
+	if this.currency == nil {
+		return this.object.A_price
+	} else {
+		return this.object.A_price * this.currency.Coefficient()
+	}
 }
 
 func (this *ShopProduct) PriceFormat(format string) string {