Updates specified properties of a collection. To add products to a collection, call the addProductsToCollection function.
This function requires elevated permissions and runs only on the backend and on dashboard pages.
function updateCollection(
_id: string,
collection: UpdateCollection,
): Promise<UpdateCollectionResponse>;
Collection ID (generated automatically by the catalog).
Collection info to update.
import { products } from "wix-stores.v2";
async function updateCollection(id, collection) {
try {
const result = await products.updateCollection(id, collection);
return result;
} catch (error) {
console.error(error);
// Handle the error
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.