Skip to main content

AddToWishlistProductPageWidget

This widget allows users to add or remove the current product and its variant to or from their wishlist on product pages.

Widget example​

Add​

Add to wishlist widget example

Remove​

Remove from wishlist widget example

Code​

Liquid
<div
class="gw-wl-add-to-wishlist-placeholder"
data-gw-product-id="{{ product.id }}"
data-gw-variant-id="{% if product.selected_or_first_available_variant %}{{ product.selected_or_first_available_variant.id }}{% else %}null{% endif %}"
data-gw-button-class="custom-class-name"
style="display: block"
></div>

Attributes​

Attributes
data-gw-product-idrequired
Specifies the unique identifier for the product to be added or removed from the wishlist.
data-gw-variant-idrequired
Specifies the unique identifier for the product variant to be added or removed from the wishlist.
data-gw-button-class?optional
Specifies the custom class name for the button.