unset shopify properties if search fails
This commit is contained in:
@ -68,6 +68,10 @@ export function columnOnEditHandler(e: GoogleAppsScript.Events.SheetsOnEdit) {
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
case "compare_at_price":
|
||||
toastAndLog(updateString)
|
||||
updateProductToShopify(row)
|
||||
break
|
||||
default:
|
||||
continue
|
||||
}
|
||||
|
||||
@ -83,6 +83,12 @@ export class Product {
|
||||
let product = shop.GetProductBySku(this.sku)
|
||||
if (product == undefined || product.id == undefined || product.id == "") {
|
||||
console.log("MatchToShopifyProduct: no product matched")
|
||||
this.shopify_id = ""
|
||||
this.shopify_product = {} as shopify.Product
|
||||
this.shopify_default_variant_id = ""
|
||||
this.shopify_default_option_id = ""
|
||||
this.shopify_default_option_value_id = ""
|
||||
this.shopify_status = ""
|
||||
return
|
||||
}
|
||||
this.shopify_product = product
|
||||
|
||||
Reference in New Issue
Block a user