Home > widget-integration > CombinedProductListingsController
CombinedProductListingsController class
Signature:
export declare class CombinedProductListingsController
Constructors
|
Constructor |
Modifiers |
Description |
|---|---|---|
|
(constructor)(swatchService, combinedProductListingsService) |
Constructs a new instance of the |
Properties
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
|
Map<string, PreOrderVariant[]> | ||
|
|
Map<string, PreOrderData> | ||
|
|
string | ||
|
|
string | ||
|
|
Map<string, CombinedListingState | null> | ||
|
|
Map<string, Promise<void>> | ||
|
CombinedListingState | null | |||
|
(modal: HTMLElement) => void |
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
Clears child variant and selected child variant from state. Used when no parent variant is selected or when resetting. | ||
|
Clear all caches for combined listing data. | ||
|
Removes combined listing child product/variant IDs from sessionStorage. Called when the quick-view modal is closed to prevent stale child IDs from being picked up by subsequent tracking events on normal (non-combined) products. | ||
|
Ensure combined listing state is loaded and cached. Checks configuration and attempts to fetch if enabled or product appears to be combined listing. | ||
|
| ||
|
findVariantInCombinedListing(variantId, product, getVariantById) | ||
|
| ||
|
Return the variant for cart actions: child, parent fallback, or null when pending. | ||
|
handleCombinedParentSwatchSelect(modal, option, variants, triggerUpdate) |
Handles parent swatch selection for combined listing products. Matches variant by merged_options, resolves child, auto-selects first child variant. Equivalent to handleSwatchSelect but for combined-listing parent swatches. | |
|
Handles parent swatch change: resolves child product, clears previous child selection, auto-selects first available child variant, and persists to session. | ||
|
True when the child has real user-selectable options (not just a single "Default Title"). | ||
|
| ||
|
hydrateCombinedChildVariantPreorder(childProductId, childVariantId, onPreorderHydrated) |
| |
|
initCombinedListingState(modal, preOrderVariants, getSelectedVariant, handleSwatchSelect) |
Resolve child product for the selected parent variant and initialise state on modal open. | |
|
initCombinedListingThumbnailNavigation(modal, fallbackImages, hooks) |
Initializes thumbnail navigation for combined listing slider. Resolves images from current child variant state with fallback. | |
|
Initializes combined listing state from product data if the feature is enabled. Sets | ||
|
Inject prev/next thumbnail nav button wrappers when absent from the modal. | ||
|
| ||
|
|
Fetch and cache combined listing data with deduplication. If a fetch is already in progress, waits for it instead of fetching again. | |
|
resolveCombinedChildVariant(parentVariant, preferredChildVariantId, hydrateFromCache, findVariant) | ||
|
resolveCurrentVariantIdForChange(getVariantIdFromUrl, getSelectedVariant, getFirstAvailableVariant) | ||
|
Persists the active combined listing child product and variant IDs to sessionStorage. This enables the analytics module ( Called after combined listing state changes: modal open, parent swatch change, and child swatch change. Clears keys when no child is active. | ||
|
Shows the "unavailable" state for combined listing when no parent variant is matched. Disables ATC, hides buy-now and pre-order blocks. | ||
|
syncCombinedListingSlider(modal, images, sliderRef, onThumbClick) |
Sync slider slides and thumbnail strip to the given images. Only called when a child product is active. | |
|
syncCombinedSliderIfChildActive(modal, fallbackImages, sliderRef, onThumbClick) |
Resolves images for the combined slider and syncs the slider DOM if a child variant is active. Returns the resolved images array for the caller to use for UI updates. | |
|
| ||
|
Mark child swatch labels sold-out when no available variant covers that option value. | ||
|
Update price and ATC button after swatch changes (parent-only / child pending / child resolved). | ||
|
updateCombinedQuickViewUI(modal, selectedVariant, fallbackImages, sliderRef, hooks) |
Full UI update orchestration for combined listing products in quick-view. Handles: no-variant state (clear child, disable swatches, reset slider), variant-selected state (price/ATC, labels, detail link, slider sync). | |
|
|