2.0 Beta

Smootify 2.0 is in public beta. Your 1.x store keeps working. Move when you want.

What changed

smootify:wishlist:changed_variant

`wishlist-toggle[data-use-variants]`: the toggle follows another variant

v2.0 beta
Open .md
On this page
  1. Listen
  2. Payload
  3. ProductVariant

wishlist-toggle[data-use-variants]: the toggle follows another variant Since 1.x.

Its 1.x name, smootify_wishlist:changed_variant, is dispatched too, with the same payload, until 3.0.

Listen

window.Smootify = window.Smootify || [];
window.Smootify.push((api) => {
  api.on("wishlist:changed_variant", (payload) => {
    // …
  });
});

Payload

{ node: HTMLElement; variant?: ProductVariant }

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)[];
}

    ↑ ↓ to moveEnter to openEsc to close