Added all to cart Event

Event triggered when adding all Items to cart from Swym Wishlist UI.

sw:addedalltocart

Can be triggered when multiple products are added to the user’s cart in a single request.

Definition

swat.evtLayer.addEventListener('sw:addedalltocart', listener);

Example

By adding this event listener, sw:addedalltocart event gets fired from the Swym Default UI on adding multiple products to the Cart using the add all to cart button.

// Define eventname
let event = 'sw:addedalltocart';

// Define the event listener function
let listener = function(e) { 
  var data = e.detail.d.productData;	
  console.log("YAY! Added all products to cart", data);
  // update button state here...
};

// Add listener for the 'addedalltocart' event to the Swym Event Layer
swat.evtLayer.addEventListener(event, listener);