Custom Event

Custom event for adding to wish list

f you want your custom button to add a product to the wish list from any other page than a product page or if you wish to overwrite the product on the current page, you can simply do this by calling the add_to_wishlist() function and passing along an Object with the specific product attributes.
1
// Custom event to add a product to the visitors wish list
2
ADDWISH_PARTNER_NS.add_to_wishlist({
3
title: 'T-shirt',
4
url: 'https://webshop.com/t-shirt.html',
5
imgUrl: 'https://webshop.com/images/t-shirt-front-medium.png',
6
price: 'DKK 100.00'
7
})
Copied!
Please make sure to replace T-shirt, https://webshop.com/t-shirt.html, https://webshop.com/images/t-shirt-front-medium.png and DKK 100.00 with the current product title, canonical URL, image URL and price of the product the visitor are currently adding to the wish list.

Arguments

Argument
Type
Description
title
String
The title of the product.
url
String
The canonical URL of the product.
imgUrl
String
A image URL of the product.
price
String
The price of the product.
Last modified 1yr ago
Copy link