Removed From Wishlist Event
Event triggered when removing a product from wishlist.
sw:removedfromwishlist
Can be triggered when a product is removed from the user’s wishlist.
Definition
swat.evtLayer.addEventListener('sw:removedfromwishlist', listener)
Example
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": "https://demo.swym.it/products/ceramic-oval-basin",
"empi": 7096231231686,
"epi": 41254655393990,
"id": "6acaeaa1-43a9-4aee-8aea-a143a9baee1b",
"iu": "https://cdn.shopify.com/s/files/1/0534/3635/0662/products/ceramicovalbasin_620x620.jpg?v=1637582881",
"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
}
Updated 4 months ago