omg this is working
This commit is contained in:
@ -1,22 +1,34 @@
|
||||
import { Shop } from "./shopifyApi"
|
||||
import { getShopifyProducts, runShopifyOrders } from "./shopifyApi"
|
||||
import { fillProductFromTemplate } from "./fillProductFromTemplate"
|
||||
import { createMissingPhotoFolders } from "./createMissingPhotoFolders"
|
||||
import { matchProductToShopify } from "./match"
|
||||
|
||||
function initMenu() {
|
||||
export function initMenu() {
|
||||
let ui = SpreadsheetApp.getUi()
|
||||
ui.createMenu("BLM")
|
||||
.addItem("Fill out product from template", "fillProductFromTemplate")
|
||||
.addItem("Create missing photo folders", "createMissingPhotoFolders")
|
||||
.addSubMenu(
|
||||
ui
|
||||
.createMenu("This row...")
|
||||
.addItem("Fill out product from template", fillProductFromTemplate.name)
|
||||
.addItem("Match product to Shopify", matchProductToShopifyHandler.name)
|
||||
)
|
||||
.addSeparator()
|
||||
.addItem("Run Shopify Orders", "runShopifyOrders")
|
||||
.addItem("Get Shopify Products", "getShopifyProducts")
|
||||
.addSubMenu(
|
||||
ui
|
||||
.createMenu("Bulk operations...")
|
||||
.addItem("Create missing photo folders", createMissingPhotoFolders.name)
|
||||
.addItem("Run Shopify Orders", runShopifyOrders.name)
|
||||
.addItem("Get Shopify Products", getShopifyProducts.name)
|
||||
)
|
||||
.addToUi()
|
||||
}
|
||||
|
||||
function runShopifyOrders() {
|
||||
let shop = new Shop()
|
||||
shop.RunOrders()
|
||||
}
|
||||
|
||||
function getShopifyProducts() {
|
||||
let shop = new Shop()
|
||||
shop.GetProducts()
|
||||
export function matchProductToShopifyHandler() {
|
||||
var sheet = SpreadsheetApp.getActive().getActiveSheet()
|
||||
if (sheet.getName() !== "product_inventory") {
|
||||
console.log("skipping edit on sheet " + sheet.getName())
|
||||
return
|
||||
}
|
||||
let row = SpreadsheetApp.getCurrentCell().getRow()
|
||||
matchProductToShopify(row)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user