omg this is working

This commit is contained in:
Ben Miller
2024-11-13 23:43:32 -07:00
parent fb86c9c96d
commit a5c0a1176d
22 changed files with 2152 additions and 53 deletions

View File

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