add Shopify category to product

This commit is contained in:
Ben Miller
2025-08-31 20:22:30 -06:00
parent 6d75973835
commit 688536d0ac

View File

@ -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