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
| Parameter | Type | Description |
|---|---|---|
productCode | string | Your code of the variant. |
dimension1Title | string | Value of the first dimension, e.g. 'Red'. |
dimension2Title | string | Value 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? | string | Variant name shown in the editor. |
quantity? | number | Quantity 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);
});