Interface: IEditorArgumentsPartialProductBuilder
Sets the model of a catalog product and optionally preselects variants. You get it as the argument of the buildProduct callback of setPartialProduct.
Methods
selectVariant()
ts
selectVariant(
productCode: string,
quantity?: number,
codeOverride?: string,
nameOverride?: string
): IEditorArgumentsPartialProductBuilder;Preselects a variant of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
productCode | string | Supplier code of the product variant. |
quantity? | number | Quantity of the variant. |
codeOverride? | string | Variant code to show instead of the catalog one. |
nameOverride? | string | Variant name to show instead of the catalog one. |
Returns
IEditorArgumentsPartialProductBuilder
Example
js
window.tronDesigner.setPartialProduct('PFC', undefined, (b) =>
b.setProductModel('100860').selectVariant('10086021', 100)
);selectVariants()
ts
selectVariants(...variants: ArgAddProductVariant[]): IEditorArgumentsPartialProductBuilder;Preselects several variants of the model.
Parameters
| Parameter | Type | Description |
|---|---|---|
...variants | ArgAddProductVariant[] | The variants, each with at least productCode (see ArgAddProductVariant). |
Returns
IEditorArgumentsPartialProductBuilder
setProductModel()
ts
setProductModel(modelCode: string): IEditorArgumentsPartialProductBuilder;Sets the product model; the customer chooses its variants in the editor.
Parameters
| Parameter | Type | Description |
|---|---|---|
modelCode | string | Model code of the product in the catalog, e.g. '100860'. |
Returns
IEditorArgumentsPartialProductBuilder
Example
js
window.tronDesigner.setPartialProduct('PFC', undefined, (b) => b.setProductModel('100860'));