Home > widget-integration > QuickViewController > getVariantOptionValueAt

QuickViewController.getVariantOptionValueAt() method

Value variant carries for the swatch group at optionIndex.

merged_options and original_merged_options are "OptionName:Value" entries ordered like the swatch groups. original_merged_options wins for a given position because the quick view template builds the labels from it when it is present, but either list can be empty or shorter than the option count, so each source is consulted per index before falling back on the title ("V1 / V2 / ..." in the same order). Returns null when no source resolves the position.

Deliberately different from CombinedProductListingsController, which ORs both lists and searches every entry: matching a value regardless of its position is what let a name shared by two options collide.

Signature:

protected getVariantOptionValueAt(variant: PreOrderVariant, optionIndex: number): string | null;

Parameters

Parameter

Type

Description

variant

PreOrderVariant

optionIndex

number

Returns:

string | null