From cb2ae6a856f6764fbfeade4637a5fa3897356e0b Mon Sep 17 00:00:00 2001 From: merdan Date: Sat, 10 Sep 2022 14:32:19 +0500 Subject: [PATCH] link parse fx5 --- controllers/ImportController.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/controllers/ImportController.go b/controllers/ImportController.go index 8ea44c7..bb1ad4f 100644 --- a/controllers/ImportController.go +++ b/controllers/ImportController.go @@ -671,7 +671,11 @@ func collectAttributes(variant *models.Product, option *gm.AttributeOption) ([]g func prepearAttributesWithFlat(data *models.Product) ([]gm.ProductAttributeValue, gm.ProductFlat) { - weight, _ := strconv.ParseFloat(data.Weight, 64) + weight, wEror := strconv.ParseFloat(data.Weight, 64) + + if wEror != nil || weight == 0 { + weight = 0.5 + } var description string