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.

// Custom event to add a product to the visitors wish list
ADDWISH_PARTNER_NS.add_to_wishlist({
title: 'T-shirt',
url: 'https://webshop.com/t-shirt.html',
imgUrl: 'https://webshop.com/images/t-shirt-front-medium.png',
price: 'DKK 100.00'
})

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.