smootify:wishlist:changed_variant_state
The smootify:wishlist:changed_variant_state event.
On this page
Since 1.x.
Its 1.x name, smootify_wishlist:changed_variant_state, is dispatched too, with the same payload, until 3.0.
Listen
window.Smootify = window.Smootify || [];
window.Smootify.push((api) => {
api.on("wishlist:changed_variant_state", (payload) => {
// …
});
});Payload
{ node: HTMLElement; variant: ProductVariant; active: boolean }ProductVariant
export interface ProductVariant {
/** `gid://shopify/ProductVariant/<id>` */
id: string;
title: string;
sku: string | null;
barcode: string | null;
availableForSale: boolean;
currentlyNotInStock: boolean;
quantityAvailable: number | null;
weight: number | null;
weightUnit: string;
price: Money;
compareAtPrice: Money | null;
unitPrice: Money | null;
quantityRule: QuantityRule;
image: { id: string | null; url: string; altText: string | null } | null;
selectedOptions: SelectedOption[];
sellingPlanAllocations: { nodes: { sellingPlan: { id: string } }[] };
metafields: (Metafield | null)[];
}