Skip to main content

ProductOptionGroupService

Contains methods relating to ProductOptionGroup entities.

Signature

constructor

method(connection: TransactionalConnection, translatableSaver: TranslatableSaver, customFieldRelationService: CustomFieldRelationService, productOptionService: ProductOptionService, eventBus: EventBus, translator: TranslatorService, listQueryBuilder: ListQueryBuilder, channelService: ChannelService, roleService: RoleService) => ProductOptionGroupService

findAll

method(ctx: RequestContext, options?: ListQueryOptions<ProductOptionGroup>, relations?: RelationPaths<ProductOptionGroup>) => Promise<PaginatedList<Translated<ProductOptionGroup>>>

findOne

method(ctx: RequestContext, id: ID, relations?: RelationPaths<ProductOptionGroup>, findOneOptions?: { includeSoftDeleted: boolean }) => Promise<Translated<ProductOptionGroup> | undefined>

getOptionGroupsByProductId

method(ctx: RequestContext, id: ID) => Promise<Array<Translated<ProductOptionGroup>>>

getOptionGroupChannels

method(ctx: RequestContext, optionGroupId: ID) => Promise<Channel[]>

Returns all Channels to which the ProductOptionGroup is assigned.

getProductCount

method(ctx: RequestContext, optionGroupId: ID) => Promise<number>

Returns the number of non-deleted Products in the current channel that use the given ProductOptionGroup.

create

method(ctx: RequestContext, input: Omit<CreateProductOptionGroupInput, 'options'>) => Promise<Translated<ProductOptionGroup>>

update

method(ctx: RequestContext, input: UpdateProductOptionGroupInput) => Promise<Translated<ProductOptionGroup>>

delete

method(ctx: RequestContext, id: ID, force: boolean = false) => Promise<DeletionResponse>

Deletes a ProductOptionGroup. If the group is in use by any Products, the deletion will fail unless force is set to true.

deleteGroupAndOptionsFromProduct

method(ctx: RequestContext, id: ID, productId: ID) =>

Deletes the ProductOptionGroup and any associated ProductOptions. If the ProductOptionGroup is still referenced by a soft-deleted Product, then a soft-delete will be used to preserve referential integrity. Otherwise a hard-delete will be performed.

assignProductOptionGroupsToChannel

method(ctx: RequestContext, input: AssignProductOptionGroupsToChannelInput) => Promise<Array<Translated<ProductOptionGroup>>>

Assigns ProductOptionGroups to the specified Channel

removeProductOptionGroupsFromChannel

method(ctx: RequestContext, input: RemoveProductOptionGroupsFromChannelInput) => Promise< Array<ErrorResultUnion<RemoveProductOptionGroupFromChannelResult, Translated<ProductOptionGroup>>> >

Removes ProductOptionGroups from the specified Channel

Was this chapter helpful?
Report Issue
Edited Mar 10, 2026ยทEdit this page