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
| Parameter | Type | Description |
|---|---|---|
productCode | string | Your code of the variant. |
dimension1Title | string | Value 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? | string | Variant name shown in the editor. |
quantity? | number | Quantity of the variant. |
ownPreviewUrl? | string | URL 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);
});