Browse Source

Product group name template function

Vova Tkach 5 years ago
parent
commit
f2372057cd
2 changed files with 10 additions and 0 deletions
  1. 3 0
      engine/fetdata/shop.go
  2. 7 0
      engine/fetdata/shop_product.go

+ 3 - 0
engine/fetdata/shop.go

@@ -52,6 +52,7 @@ func (this *Shop) load() *Shop {
 			shop_products.user,
 			shop_products.currency,
 			shop_products.price,
+			shop_products.gname,
 			shop_products.name,
 			shop_products.alias,
 			shop_products.vendor,
@@ -202,6 +203,7 @@ func (this *Shop) load() *Shop {
 				shop_products.user,
 				shop_products.currency,
 				shop_products.price,
+				shop_products.gname,
 				shop_products.name,
 				shop_products.alias,
 				shop_products.vendor,
@@ -328,6 +330,7 @@ func (this *Shop) load() *Shop {
 					&rp.A_user,
 					&rp.A_currency,
 					&rp.A_price,
+					&rp.A_gname,
 					&rp.A_name,
 					&rp.A_alias,
 					&rp.A_vendor,

+ 7 - 0
engine/fetdata/shop_product.go

@@ -143,6 +143,13 @@ func (this *ShopProduct) PriceFormat(format string) string {
 	return utils.Float64ToStrF(this.Price(), format)
 }
 
+func (this *ShopProduct) Group() string {
+	if this == nil {
+		return ""
+	}
+	return this.object.A_gname
+}
+
 func (this *ShopProduct) Name() string {
 	if this == nil {
 		return ""