Search...
resetAllProductVariantData( )
Developer Preview
Resets the data (such as the price and the weight) of all variants for a given product to their default values.
Admin Method
This function requires elevated permissions to run. This function is not universal and runs only on the backend.
Syntax
function resetAllProductVariantData(_id: string): Promise<void>
resetAllProductVariantData Parameters
NAME
TYPE
DESCRIPTION
_id
string
Product ID.
Returns
Return Type:
Promise<
void
>Was this helpful?
resetAllProductVariantData example
Copy Code
1import { products } from 'wix-stores.v2';23 async function resetAllProductVariantData(id) {4 try {5 const result = await products.resetAllProductVariantData(id);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13