Skip to content

Interface: IEditorArgumentsOwnSingleDimensionProductBuilder ​

Adds the variants of an own product with one dimension. You get it as the argument of the buildProduct callback of setOwnProductSingleDimension.

Methods ​

addVariant() ​

ts
addVariant(
   productCode: string, 
   dimension1Title: string, 
   dimension1Colors?: string[], 
   productName?: string, 
   quantity?: number, 
   ownPreviewUrl?: string
): IEditorArgumentsOwnSingleDimensionProductBuilder;

Adds a variant of the own product.

Parameters ​

ParameterTypeDescription
productCodestringYour code of the variant.
dimension1TitlestringValue of the dimension for this variant, e.g. 'Red' or 'XL'.
dimension1Colors?string[]Colors of the variant as hex codes, e.g. ['#FF0000'], when the dimension is a color.
productName?stringVariant name shown in the editor.
quantity?numberQuantity of the variant.
ownPreviewUrl?stringURL of a preview image of the variant.

Returns ​

IEditorArgumentsOwnSingleDimensionProductBuilder

Example ​

js
window.tronDesigner.setOwnProductSingleDimension('MUG-01', 'Custom Ceramic Mug', true, undefined, (p) => {
  p.addVariant('MUG-01-RED', 'Red', ['#FF0000'], 'Ceramic Mug - Red', 10);
});

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