From 688536d0ac41349bd387e49445f59a243a9c16ee Mon Sep 17 00:00:00 2001 From: Ben Miller Date: Sun, 31 Aug 2025 20:22:30 -0600 Subject: [PATCH] add Shopify category to product --- src/Product.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Product.ts b/src/Product.ts index 4ff506e..5df6370 100644 --- a/src/Product.ts +++ b/src/Product.ts @@ -115,13 +115,11 @@ export class Product { } ShopifyCategory(): string { - return vlookupByColumns("values", "product_type", this.category, "shopify_category") + return vlookupByColumns("values", "product_type", this.product_type, "shopify_category") } ToShopifyProductSet() { let sps = new ShopifyProductSetInput() - //TODO: map category IDs - //sps.category = this.category if (this.shopify_id != "") { sps.id = this.shopify_id } @@ -129,7 +127,10 @@ export class Product { sps.status = this.shopify_status } sps.productType = this.product_type - sps.category = this.ShopifyCategory() + let category = this.ShopifyCategory() + if (category !== "") { + sps.category = this.ShopifyCategory() + } sps.tags = this.tags sps.title = this.title sps.descriptionHtml = this.description