Browse Source

Hotfix, basket with different sessions

Vova Tkach 5 years ago
parent
commit
4be7b7603f
1 changed files with 7 additions and 0 deletions
  1. 7 0
      engine/basket/basket.go

+ 7 - 0
engine/basket/basket.go

@@ -59,6 +59,13 @@ func (this *Basket) Plus(p *SBParam, product_id int) string {
 		if s, ok := h.sessions[p.SessionId]; ok == true {
 			s.Preload(p)
 			s.Plus(p, product_id)
+		} else {
+			s := &session{}
+			s.listCurrencies = map[int]*currency{}
+			s.Products = map[int]*product{}
+			s.Preload(p)
+			s.Plus(p, product_id)
+			h.sessions[p.SessionId] = s
 		}
 	} else {
 		s := &session{}