Skip to content

Interface: IEditorArgumentsOwnTwoDimensionsProductBuilder ​

Adds the variants of an own product with two dimensions. You get it as the argument of the buildProduct callback of setOwnProductTwoDimensions.

Methods ​

addVariant() ​

ts
addVariant(
   productCode: string, 
   dimension1Title: string, 
   dimension2Title: string, 
   dimension1Colors?: string[], 
   dimension2Colors?: string[], 
   productName?: string, 
   quantity?: number
): IEditorArgumentsOwnTwoDimensionsProductBuilder;

Adds a variant of the own product.

Parameters ​

ParameterTypeDescription
productCodestringYour code of the variant.
dimension1TitlestringValue of the first dimension, e.g. 'Red'.
dimension2TitlestringValue of the second dimension, e.g. 'XL'.
dimension1Colors?string[]Colors for the first dimension as hex codes, e.g. ['#FF0000'].
dimension2Colors?string[]Colors for the second dimension as hex codes.
productName?stringVariant name shown in the editor.
quantity?numberQuantity of the variant.

Returns ​

IEditorArgumentsOwnTwoDimensionsProductBuilder

Example ​

js
window.tronDesigner.setOwnProductTwoDimensions('TEE-01', 'Organic T-shirt', true, undefined, (p) => {
  p.addVariant('TEE-01-RED-M', 'Red', 'M', ['#FF0000']);
  p.addVariant('TEE-01-RED-L', 'Red', 'L', ['#FF0000'], undefined, undefined, 20);
});

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