Hello to all! It is necessary to completely hide the product from the store if its quantity is zero. The specification describes the updateProductFields () method, it accepts an object that can contain a visibility property. I tried to use this. But it does not work…
I am developing a script to automatically update a store. If you help me I can post it
export async function update(item) {
try {
let result = 1;
item.visible = false;
item["visible"] = false;
let product = (await wixStoresBackend.updateProductFields(item._id, item)
.catch((error) => {
console.log("Updating error. ID: " + item._id);
console.log(error);
result = 0;
}));
await updateInventory(product, item);
return result;
} catch (e) {
return 0;
}
}
I spent several hours testing, but I still haven’t got any results.