Before the AddToCart event.
1
When you need a simple action before the add to cart event happen, like analytics or other logic triggers.
For more complex interactions see override / extend plugin.
For minor actions use the code below, this works runtime after JS plugins have been initialized.
PluginManager.getPluginInstances("AddToCart").forEach(function (element) {
element.$emitter.subscribe('beforeFormSubmit', function (event) {
console.log("ADD TO CART", event)
});
});
Works from ^6.3
There are no comments yet
Be the first one to comment