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