Type Alias: AddToCart()
AddToCart = () =>
void
Triggers the "add to cart" or "finish" action for the current configuration.
This method programmatically executes the same action that occurs when a user clicks the "Add to Cart" or "Finish" button in the configurator. It prepares all the necessary configuration details and dispatches the appropriate events.
Returns
void
Example
// Add the current configuration to the cart when a custom button is clicked
document.getElementById('custom-add-to-cart').addEventListener('click', () => {
window.mimeeqApp.utils.addToCart();
});
// Listen for the add to cart event to handle the data
document.addEventListener('mimeeq-add-to-cart', (e) => {
console.log('Product added to cart:', e.detail);
// Add the product to your e-commerce system
});
Fires
@mimeeq/mimeeq-add-to-cart