Skip to content

Interface: IEditorArgumentsExactProductBuilder ​

Adds the variants of a catalog product. You get it as the argument of the buildProduct callback of setExactProduct.

Methods ​

addVariant() ​

ts
addVariant(
   productCode: string, 
   quantity?: number, 
   codeOverride?: string, 
   nameOverride?: string
): IEditorArgumentsExactProductBuilder;

Adds a product variant from the catalog.

Parameters ​

ParameterTypeDescription
productCodestringSupplier code of the product variant, e.g. '10086021'.
quantity?numberQuantity of the variant.
codeOverride?stringVariant code to show instead of the catalog one (e.g. your shop's SKU).
nameOverride?stringVariant name to show instead of the catalog one.

Returns ​

IEditorArgumentsExactProductBuilder

Example ​

js
window.tronDesigner.setExactProduct('PFC', undefined, (b) => {
  b.addVariant('10086021', 100);
  b.addVariant('10086055', 50, 'SKU-55', 'Pen, blue');
});

addVariants() ​

ts
addVariants(...variants: ArgAddProductVariant[]): IEditorArgumentsExactProductBuilder;

Adds several product variants from the catalog.

Parameters ​

ParameterTypeDescription
...variantsArgAddProductVariant[]The variants, each with at least productCode (see ArgAddProductVariant).

Returns ​

IEditorArgumentsExactProductBuilder

Example ​

js
window.tronDesigner.setExactProduct('PFC', undefined, (b) =>
  b.addVariants({ productCode: '10086021', quantity: 100 }, { productCode: '10086055' })
);

Czech Republic – The Country for the FutureFunded by the European Union – NextGenerationEUThe project was implemented within the The Country for the Future programme of the Ministry of Industry and Trade and co-financed by the European Union under NextGenerationEU.Support · Examples

Czech Republic – The Country for the FutureFunded by the European Union – NextGenerationEUThe project was implemented within the The Country for the Future programme of the Ministry of Industry and Trade and co-financed by the European Union under NextGenerationEU.Support · Examples