Removed From Wishlist Event

Event triggered when removing a product from wishlist.


Can be triggered when a product is removed from the user’s wishlist.


swat.evtLayer.addEventListener('sw:removedfromwishlist', listener)


By adding this event listener, sw:removedfromwishlist event gets fired from the Swym Default UI on removing a product from the Wishlist.

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

// Define the event listener function
let listener = function(e) { 
  var data = e.detail.d.productData;	
  console.log("YAY! Removed the product from wishlist", data);
  // update button state here...

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

Success Response

The success response consists of a console.log message with the text 'YAY! Removed the product from wishlist' and a JSON that contains details of the product removed from Wishlist.

  "bt": "Swym Marketing",
  "cts": 1679570510837,
  "di": "c3feba7e-c0e0-47cb-be5e-5c32e688fa84",
  "dt": "Ceramic Oval Basin",
  "du": "",
  "empi": 7096231231686,
  "epi": 41254655393990,
  "id": "6acaeaa1-43a9-4aee-8aea-a143a9baee1b",
  "iu": "",
  "lid": "9f63f7b3-2db4-42ae-bf8b-d728484cad60",
  "pid": "KABSbuGyYCuM6/IV7e7cGxT1978LieU1jRdMt6XhYfo=",
  "pr": 300,
  "sku": "23",
  "uts": 1679570510837,
  "_attachments": "attachments/",
  "_etag": "\"7c006df6-0000-0800-0000-641c364e0000\"",
  "_pkey": "c3feba7e",
  "_rid": "JkFjANdNmCOHDusCAACABw==",
  "_self": "dbs/JkFjAA==/colls/JkFjANdNmCM=/docs/JkFjANdNmCOHDusCAACABw==/",
  "_t": 2,
  "_ts": 1679570510