marketplace product id

This commit is contained in:
merdan 2022-09-15 17:32:15 +05:00
parent 41a3552a97
commit 9fcd76a3db
1 changed files with 12 additions and 6 deletions

View File

@ -589,13 +589,19 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
}
func createSellerProduct(flat *gm.ProductFlat, sellerURL string) gm.MarketplaceProduct {
sellerID := sellers[sellerURL].ID
if sellerID == 0 {
sellerID = 1
}
sellerProduct := gm.MarketplaceProduct{
MarketplaceSeller: sellers[sellerURL],
IsApproved: true,
Condition: "new",
Description: "scraped",
IsOwner: true,
ProductID: flat.ProductID,
MarketplaceSellerID: sellerID,
IsApproved: true,
Condition: "new",
Description: "scraped",
IsOwner: true,
ProductID: flat.ProductID,
}
for _, variant := range flat.Variants {