Skip to main content
Skip to main content

updateOptions - Product Module Reference

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

updateOptions(id, data, sharedContext?): Promise<ProductOptionDTO>

This method is used to update a option.

Example

const option = await productModuleService.updateOptions(
"opt_123",
{
title: "Color",
}
)

Parameters

idstringRequired
The ID of the option to be updated.
The attributes of the option to be updated
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductOptionDTO>Required
The updated option.

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

This method is used to update a list of options matching the specified filters.

Example

const options = await productModuleService.updateOptions(
{
title: "Color",
},
{
values: ["Blue", "Green"],
}
)

Parameters

The filters specifying which options to update.
The attributes to be updated on the selected options
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ProductOptionDTO[]>Required
The updated options.
Was this section helpful?