resetVariantData( )


Resets the data (such as the price and the weight) of all variants for a given product to their default values.

The resetVariantData() function returns a Promise that resolves when a product's variants have been reset.

Note: The Manage Variants field for the product must be set to true to reset variant data.

Method Declaration
Copy
function resetVariantData(productId: string): Promise<void>;
Method Parameters
productIdstringRequired

ID of the product whose variants should be reset.

Reset the data of a variant to their default values
JavaScript
import wixStoresBackend from "wix-stores-backend"; export function resetVariantData(productId) { wixStoresBackend .resetVariantData(productId) .then(() => { // product variants have been reset to original values }) .catch((err) => { // there was an error resetting the product variants }); }
Errors

This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Did this help?