marketplace product id
This commit is contained in:
parent
41a3552a97
commit
9fcd76a3db
|
|
@ -589,13 +589,19 @@ func ImportProduct(product models.Product, db *gorm.DB) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func createSellerProduct(flat *gm.ProductFlat, sellerURL string) gm.MarketplaceProduct {
|
func createSellerProduct(flat *gm.ProductFlat, sellerURL string) gm.MarketplaceProduct {
|
||||||
|
sellerID := sellers[sellerURL].ID
|
||||||
|
|
||||||
|
if sellerID == 0 {
|
||||||
|
sellerID = 1
|
||||||
|
}
|
||||||
|
|
||||||
sellerProduct := gm.MarketplaceProduct{
|
sellerProduct := gm.MarketplaceProduct{
|
||||||
MarketplaceSeller: sellers[sellerURL],
|
MarketplaceSellerID: sellerID,
|
||||||
IsApproved: true,
|
IsApproved: true,
|
||||||
Condition: "new",
|
Condition: "new",
|
||||||
Description: "scraped",
|
Description: "scraped",
|
||||||
IsOwner: true,
|
IsOwner: true,
|
||||||
ProductID: flat.ProductID,
|
ProductID: flat.ProductID,
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, variant := range flat.Variants {
|
for _, variant := range flat.Variants {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue