Alokai

ProductOption

Definition of product options

interface ProductOption {
	config: ProductOptionConfig | ProductOptionConfig[];
	display_name: string;
	id: number;
	name: string;
	option_values: ProductOptionValue[];
	product_id: number;
	sort_order: number;
	type: ProductOptionType;
}

Properties

NameRequiredTypeDescription
configRequiredProductOptionConfig | ProductOptionConfig[]The values for option config can vary based on the Modifier created.
display_nameRequiredstringThe name of the option shown on the storefront.
idRequirednumberThe unique numerical ID of the option, increments sequentially.
nameRequiredstringProduct option name.
option_valuesRequiredProductOptionValue[]Array of the possible values for the option
product_idRequirednumberThe unique numerical ID of the product to which the option belongs.
sort_orderRequirednumberOrder in which the option is displayed on the storefront.
typeRequiredProductOptionTypeThe type of option, which determines how it will display on the storefront. Acceptable values: * radio_buttons, * rectangles, * dropdown, * product_list, * product_list_with_images, * swatch. For reference, the former v2 API values are: * RB = radio_buttons, * RT = rectangles, * S = dropdown, * P = product_list, * PI = product_list_with_images, * CS = swatch.

Referenced Types

On this page