misc fixes
* updateShopifyProductHandler acts on all selected rows * updateProductToShopify checks SKU more quickly * defaults are always set products
This commit is contained in:
@ -3,6 +3,7 @@ import { fillProductFromTemplate } from "./fillProductFromTemplate"
|
||||
import { createMissingPhotoFolders } from "./createMissingPhotoFolders"
|
||||
import { matchProductToShopify, updateProductToShopify } from "./match"
|
||||
import { reinstallTriggers } from "./triggers"
|
||||
import { toastAndLog } from "./sheetUtils"
|
||||
|
||||
export function initMenu() {
|
||||
let ui = SpreadsheetApp.getUi()
|
||||
@ -48,8 +49,19 @@ export function updateShopifyProductHandler() {
|
||||
console.log("skipping edit on sheet " + sheet.getName())
|
||||
return
|
||||
}
|
||||
let row = SpreadsheetApp.getCurrentCell().getRow()
|
||||
updateProductToShopify(row)
|
||||
let selectedRanges = SpreadsheetApp.getActiveRangeList().getRanges()
|
||||
if (selectedRanges == null || selectedRanges.length == 0) {
|
||||
toastAndLog("Select ranges to be updated")
|
||||
return
|
||||
}
|
||||
for (let i = 0; i < selectedRanges.length; i++) {
|
||||
let range = selectedRanges[i]
|
||||
let firstRow = range.getRow()
|
||||
let lastRow = range.getLastRow()
|
||||
for (let row = firstRow; row <= lastRow; row++) {
|
||||
updateProductToShopify(row)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function reauthorizeScript() {
|
||||
|
||||
Reference in New Issue
Block a user