Skip to main content
Skip to main content

createOptions - Product Module Reference

This documentation provides a reference to the createOptions method. This belongs to the Product Module.

createOptions(data, sharedContext?): Promise<ProductOptionDTO[]>

This method is used to create product options.

Example

const options = await productModuleService.createOptions([
{
title: "Color",
values: ["Blue", "Green"],
product_id: "prod_123",
},
{
title: "Size",
values: ["Small", "Medium"],
product_id: "prod_321",
},
])

Parameters

The product options to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductOptionDTO[]>Required
The list of created product options.

createOptions(data, sharedContext?): Promise<ProductOptionDTO>

This method is used to create a product option.

Example

const option = await productModuleService.createOptions({
title: "Color",
values: ["Blue", "Green"],
product_id: "prod_123",
})

Parameters

The product option to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductOptionDTO>Required
The created product option.
Was this section helpful?