Type Alias: SelectRelatedProduct()
SelectRelatedProduct = (
productId
,variantCode
,isModular
,isActive
) =>Promise
<void
>
Function
Navigates to a related product with the appropriate configuration.
This function handles the transition from the current product to a selected related product. It performs the necessary cleanup of the current product's state, then triggers the appropriate navigation events to open the related product with the best matching configuration.
The function ensures a smooth transition between products, maintaining context between them by applying compatible configurations when possible.
Parameters
productId
string
Unique identifier for the related product to open
variantCode
string
Complete variant code for the related product, including configuration
isModular
boolean
Whether the related product is a modular product
isActive
boolean
Whether the related product is active and available
Returns
Promise
<void
>
Example
// When a user clicks on a related product thumbnail
document.getElementById('related-chair').addEventListener('click', () => {
window.mimeeqApp.actions.selectRelatedProduct(
'chair-123', // Product ID
'CHAIR-MODEL=Finish-a3', // Variant code with matching finish
false, // Not a modular product
true // Product is active
);
});
Emits
mimeeq-open-related-product When navigating to the related product
Emits
mimeeq-app-url-change When the URL changes to the related product
Emits
mmq-app-url-change-sandbox For sandbox environment URL changes