update cart
This commit is contained in:
@@ -400,6 +400,14 @@ func (sf *StateFile) GetPromotion(id string) (*PromotionRule, bool) {
|
||||
func LoadStateFile(fileName string) (*StateFile, error) {
|
||||
f, err := os.Open(fileName)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return &StateFile{
|
||||
State: PromotionState{
|
||||
Promotions: []PromotionRule{},
|
||||
},
|
||||
Version: 1,
|
||||
}, nil
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
Reference in New Issue
Block a user