diff --git a/src/Product.ts b/src/Product.ts index ee7d0e2..af76d05 100644 --- a/src/Product.ts +++ b/src/Product.ts @@ -9,6 +9,7 @@ import { ShopifyProductSetQuery, VariantOptionValueInput, } from "./shopifyApi" +import * as shopify from 'shopify-admin-api-typings' import { getCellRangeByColumnName, getRowByColumnValue } from "./sheetUtils" export class Product { @@ -27,9 +28,10 @@ export class Product { weight_grams: number = 0 photos: string = "" shopify_product: ShopifyProduct - shopify_default_variant_id: string - shopify_default_option_id: string - shopify_default_option_value_id: string + shopify_default_variant_id: string = "" + shopify_default_option_id: string = "" + shopify_default_option_value_id: string = "" + shopify_status: string = "" constructor(sku: string = "") { if (sku == "") { @@ -127,6 +129,9 @@ export class Product { //TODO: map category IDs //sps.category = this.category sps.id = this.shopify_id + if (this.shopify_status.match('DRAFT|ACTIVE|ARCHIVED')) { + sps.status = this.shopify_status + } sps.productType = this.product_type sps.tags = this.tags sps.title = this.title