Skip to main content

Handling state of configurator

With mmq-embed component

const el = document.querySelector('.mmq-embed');
el.show();

Open configurator on button click

warning

Please note that this method is deprecated. It works only when using legacy embed code. Please use above method.

With data-mimeeq embed

document.getElementById('modularButton').addEventListener('click', () => {
// For modular configurator
document.dispatchEvent(new Event('mimeeq-show-modular'));
// For other configurators
document.dispatchEvent(new Event('mimeeq-show-configurator'));
});

Open configurator on page load when using shareable URL

warning

Please note that this solution is no longer required for embeds. If you have variant code specified in your URL (eg. by enabling Use History Navigation option in Embed Template or sharing URL to configuration) configurator will load automatically on page entry

window.onload = () => {
if (window.location.href.indexOf('variantCode') > -1) {
document.addEventListener('mimeeq-app-loaded', () => {
// with `data-mimeeq` element
// For modular configurator
document.dispatchEvent(new Event('mimeeq-show-modular'));
// For other configurators
document.dispatchEvent(new Event('mimeeq-show-configurator'));

// For mmq-embed component
const el = document.querySelector('.mmq-embed');
el.show();
});
}
};