Skip to content

TProductVariantOptions object

TProductVariantOptions is an object which represents the options for fetching product variant.

  • options: object
  • options.variantOptions: Record<string, string> choosen variant options. Key is the option id and value is the option value id.
  • options.modVOption: string - Last virtual option set
useStorefront(async (storefront) => {
    const productFetcherApi = await storefront.getApi('ProductFetcherApi');

    const getProductStockOptions = {
        variantOptions: {
            1: '23',
            2: '24'
        },
        modVOption: '24'
    };

    const productVariant = await productFetcherApi.getProductVariant(1, getProductsOptions);
    console.log(productVariant);
});