Added to Wishlist Event

Event triggered when adding a product to wishlist.


Can be triggered when a product is added to the user’s wishlist.


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


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

// Define the event
let event = 'sw:addedtowishlist';

// Define the event listener function
let listener = function(e) {
	var data = e.detail.d;
	console.log("YAY! Added the product to wishlist", data);

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

Event Response

The success response consists of a console.log message with the text _'YAY! Added the product to wishlist'.

JSON that contains details of the product added to Wishlist.

  "bt": "Swym Marketing",
  "cts": 1679570510837,
  "di": "c3feba7e-c0e0-47cb-be5e-5c32e688fa84",
  "dt": "Ceramic Oval Basin",
  "du": "",
  "empi": 7096231231686,
  "epi": 41254655393990,
  "iu": "",
  "lid": "9f63f7b3-2db4-42ae-bf8b-d728484cad60",
  "pid": "KABSbuGyYCuM6/IV7e7cGxT1978LieU1jRdMt6XhYfo=",
  "pr": 300,
  "sku": "23",
  "uts": 1679570510837,
  "_pkey": "c3feba7e",
  "_t": 2