Search...
getStoreVariant( )
Developer Preview
Retrieves a store variant with the provided ID.
Syntax
function getStoreVariant(_id: string): Promise<GetStoreVariantResponse>
getStoreVariant Parameters
NAME
TYPE
DESCRIPTION
_id
string
Store variant ID. Comprised of the productId
and the variantId
, separated by a hyphen. For example, {productId}-{variantId}
.
Returns
Return Type:
Promise<
GetStoreVariantResponse
>NAME
TYPE
DESCRIPTION
variant
StoreVariant
The requested store variant.
Was this helpful?
getStoreVariant example
Copy Code
1import { products } from 'wix-stores.v2';23 async function getStoreVariant(id) {4 try {5 const result = await products.getStoreVariant(id);67 return result;8 } catch (error) {9 console.error(error);10 // Handle the error11 }12 }13