From 69ec8b8cdd79089c6f644e85f6dde906820d5b87 Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Sat, 16 Nov 2024 05:13:47 -0700 Subject: [PATCH] include shopify_status --- src/Product.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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