2.0 Beta

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

What changed

smootify:loadedAdditionalVariants

the product page's product with every variant, when it has more than 250

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

the product page’s product with every variant, when it has more than 250 Since 1.x.

Listen

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

Payload

{ product: Product }

Product

export interface Product {
  /** `gid://shopify/Product/<id>` */
  id: string;
  title: string;
  handle: string;
  vendor: string;
  productType: string;
  descriptionHtml: string;
  tags: string[];
  isGiftCard: boolean;
  requiresSellingPlan: boolean;
  totalInventory: number | null;
  category: { name: string } | null;
  publishedAt: string;
  createdAt: string;
  metafields: (Metafield | null)[];
  collections: { nodes: { handle: string; title: string; image: { url: string } | null }[] };
  media: { nodes: ProductMedia[] };
  options: ProductOption[];
  sellingPlanGroups: { nodes: SellingPlanGroup[] };
  /** every variant on the product page; the first 250 elsewhere */
  variants: { nodes: ProductVariant[]; pageInfo: { hasNextPage: boolean; endCursor: string | null } };
}

    ↑ ↓ to moveEnter to openEsc to close