Skip to content

ProductOption model

ProductOption is a model representing data of a single product option and consists of the following fields:

  • id: string
  • name: string
  • order: number
  • isRequired: boolean
  • isStock: boolean
  • type: TProductOption
  • values: TProductOptionValue[] | undefined

TProductOptionType

TProductOptionType is a string which represents the type of the product option and can contain one of the following values:

  • color
  • file
  • text
  • radio
  • select
  • checkbox

TProductOptionValue

Represents the object with the details of a single value of an option and has the following shape:

type TProductOptionValue = {
    id: string;
    order: number;
    name: string;
    optionId: string;
    label: string;
    userValue: string;
    additionalValue: unknown;
    type: string;
    color: string | undefined;
};