partial implementation of product update
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { getShopifyProducts, runShopifyOrders } from "./shopifyApi"
|
||||
import { fillProductFromTemplate } from "./fillProductFromTemplate"
|
||||
import { createMissingPhotoFolders } from "./createMissingPhotoFolders"
|
||||
import { matchProductToShopify } from "./match"
|
||||
import { matchProductToShopify, updateProductToShopify } from "./match"
|
||||
import { reinstallTriggers } from "./triggers"
|
||||
|
||||
export function initMenu() {
|
||||
@ -12,6 +12,7 @@ export function initMenu() {
|
||||
.createMenu("This row...")
|
||||
.addItem("Fill out product from template", fillProductFromTemplate.name)
|
||||
.addItem("Match product to Shopify", matchProductToShopifyHandler.name)
|
||||
.addItem("Update Shopify Product", updateShopifyProductHandler.name)
|
||||
)
|
||||
.addSeparator()
|
||||
.addSubMenu(
|
||||
@ -41,6 +42,16 @@ export function matchProductToShopifyHandler() {
|
||||
matchProductToShopify(row)
|
||||
}
|
||||
|
||||
export function updateShopifyProductHandler() {
|
||||
var sheet = SpreadsheetApp.getActive().getActiveSheet()
|
||||
if (sheet.getName() !== "product_inventory") {
|
||||
console.log("skipping edit on sheet " + sheet.getName())
|
||||
return
|
||||
}
|
||||
let row = SpreadsheetApp.getCurrentCell().getRow()
|
||||
updateProductToShopify(row)
|
||||
}
|
||||
|
||||
export function reauthorizeScript() {
|
||||
ScriptApp.invalidateAuth()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user