Deletes an existing product.
The deleteProduct()
function returns a Promise that resolves when the
product with the given ID is deleted.
function deleteProduct(productId: string): Promise<void>;
ID of the product to delete.
import wixStoresBackend from "wix-stores-backend";
export function deleteProduct(productId) {
wixStoresBackend
.deleteProduct(productId)
.then(() => {
// product has been deleted
})
.catch((err) => {
// there was an error deleting the product
});
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.