fixes to create new products
This commit is contained in:
@ -128,7 +128,9 @@ export class Product {
|
||||
let sps = new ShopifyProductSetInput()
|
||||
//TODO: map category IDs
|
||||
//sps.category = this.category
|
||||
sps.id = this.shopify_id
|
||||
if (this.shopify_id != "") {
|
||||
sps.id = this.shopify_id
|
||||
}
|
||||
if (this.shopify_status.match('DRAFT|ACTIVE|ARCHIVED')) {
|
||||
sps.status = this.shopify_status
|
||||
}
|
||||
@ -139,7 +141,9 @@ export class Product {
|
||||
sps.variants = []
|
||||
let variant = new ShopifyVariant()
|
||||
//TODO: handle multiple variants
|
||||
variant.id = this.shopify_default_variant_id
|
||||
if (this.shopify_default_variant_id != "") {
|
||||
variant.id = this.shopify_default_variant_id
|
||||
}
|
||||
variant.sku = this.sku
|
||||
variant.price = this.price
|
||||
sps.variants.push(variant)
|
||||
|
||||
@ -847,7 +847,7 @@ export class ShopifyProductSetQuery {
|
||||
export class ShopifyProductSetInput {
|
||||
category: string
|
||||
descriptionHtml: string
|
||||
id: string
|
||||
id?: string
|
||||
productType: string
|
||||
redirectNewHandle: boolean = true
|
||||
status: string = "DRAFT"
|
||||
|
||||
Reference in New Issue
Block a user