kategoria tekst
This commit is contained in:
parent
1c1c64a9aa
commit
259e688899
|
|
@ -311,7 +311,7 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
|
|||
}
|
||||
//BEGIN TRANSACTION
|
||||
// begin a transaction
|
||||
return nil
|
||||
|
||||
tx := db.Begin()
|
||||
|
||||
if errMainProduct := tx.Omit("Categories.*", "SuperAttributes.*", "ParentID").Create(&iproduct).Error; errMainProduct != nil {
|
||||
|
|
@ -324,6 +324,9 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
|
|||
mainProductFlat.BrandID = brand.ID
|
||||
mainProductFlat.MetaKeywords = keywords
|
||||
|
||||
tx.Rollback()
|
||||
return nil
|
||||
|
||||
if errProductMainFlat := tx.Create(&mainProductFlat).Error; errProductMainFlat != nil {
|
||||
tx.Rollback()
|
||||
log.Println("ERR2" + errProductMainFlat.Error())
|
||||
|
|
|
|||
Loading…
Reference in New Issue