Skip to main content

Type Alias: MarkOption()

MarkOption = (option, blockId, widgetType, setMatchingGroup?, blockCode?) => Promise<void>

Function

Selects a specific option for a product configuration.

This method allows you to programmatically select options for the product, as if the user had clicked on them in the UI. It can be used to apply preset configurations, implement custom option selection interfaces, or automate configuration tasks.

When an option is selected, the scene updates to reflect the new configuration, and relevant events are dispatched to update the UI and pricing.

Dispatches mimeeq-select-option with the selected option data, followed by mimeeq-app-url-change to sync the URL state.

Parameters

option

OptionSetOption

Option object to select

blockId

string

ID of the block containing the option

widgetType

string

Type of widget the block is using (e.g., 'colorPicker', 'dropdown')

setMatchingGroup?

boolean

If true, attempts to match this selection in other related blocks

blockCode?

string

Name/code of the block, used for auto-sync rules

Returns

Promise<void>

Example

// Select a color option
const redOption = {
id: 'opt_123',
code: 'RED',
name: 'Cherry Red',
material3dId: 'mat_456',
// other option properties...
};

window.mimeeqApp.actions.markOption(
redOption, // Option object
'color_block', // Block ID
'colorPicker', // Widget type
true, // Set matching options in other blocks
'materials' // Block code
);