working version checkin
* add config class * add vlookup * add menu * add photo folder creation * add prep for product templates
This commit is contained in:
44
src/productTemplate.ts
Normal file
44
src/productTemplate.ts
Normal file
@ -0,0 +1,44 @@
|
||||
function productTemplate(row: number) {
|
||||
let updateColumns = [
|
||||
"function",
|
||||
"type",
|
||||
"category",
|
||||
"product_type",
|
||||
"tags",
|
||||
"price",
|
||||
"shipping",
|
||||
"weight (grams)",
|
||||
]
|
||||
|
||||
let productInventorySheet =
|
||||
SpreadsheetApp.getActiveSpreadsheet().getSheetByName("product_inventory")
|
||||
let titleValue = getCellValueByColumnName(productInventorySheet, "title", row)
|
||||
for (let i = 0; i < updateColumns.length; i++) {
|
||||
let currentValue = getCellValueByColumnName(
|
||||
productInventorySheet,
|
||||
updateColumns[i],
|
||||
row
|
||||
)
|
||||
if (currentValue != "") {
|
||||
console.log(
|
||||
"current value for '" + updateColumns[i] + "' is '" + currentValue + "'"
|
||||
)
|
||||
continue
|
||||
}
|
||||
let templateValue = vlookupByColumns(
|
||||
"product_types",
|
||||
"title",
|
||||
titleValue,
|
||||
updateColumns[i]
|
||||
)
|
||||
if (templateValue != "") {
|
||||
console.log(
|
||||
"template value for '" +
|
||||
updateColumns[i] +
|
||||
"' is '" +
|
||||
templateValue +
|
||||
"'"
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user