Browse Source

Optimization

Vova Tkach 5 years ago
parent
commit
5713196114
2 changed files with 4 additions and 3 deletions
  1. 3 2
      engine/basket/session.go
  2. 1 1
      engine/fetdata/fetdata.go

+ 3 - 2
engine/basket/session.go

@@ -6,6 +6,7 @@ import (
 	"math"
 	"strings"
 
+	"golang-fave/consts"
 	"golang-fave/engine/sqlw"
 	"golang-fave/utils"
 )
@@ -145,7 +146,7 @@ func (this *session) updateProducts(db *sqlw.DB) {
 						// Load product image here
 						var product_image string
 						if img_filename == "" {
-							product_image = "/assets/sys/placeholder.png"
+							product_image = "/" + consts.AssetsSysPlaceholderPng
 						} else {
 							product_image = "/products/images/" + img_product_id + "/thumb-0-" + img_filename
 						}
@@ -335,7 +336,7 @@ func (this *session) Plus(p *SBParam, product_id int) {
 		// Load product image here
 		var product_image string
 		if img_filename == "" {
-			product_image = "/assets/sys/placeholder.png"
+			product_image = "/" + consts.AssetsSysPlaceholderPng
 		} else {
 			product_image = "/products/images/" + img_product_id + "/thumb-0-" + img_filename
 		}

+ 1 - 1
engine/fetdata/fetdata.go

@@ -210,5 +210,5 @@ func (this *FERData) ShopBasketProductsCount() int {
 }
 
 func (this *FERData) ImagePlaceholderHref() string {
-	return "/assets/sys/placeholder.png"
+	return "/" + consts.AssetsSysPlaceholderPng
 }