2.0 Beta

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

What changed

smootify:cart_updated

every change of the cart, the first load included

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

every change of the cart, the first load included Since 1.x.

Listen

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

Payload

Cart

Cart

export interface Cart {
  /** `gid://shopify/Cart/<id>` */
  id: string;
  checkoutUrl: string;
  totalQuantity: number;
  note: string | null;
  attributes: Attribute[];
  buyerIdentity: {
    countryCode: string | null;
    email: string | null;
    phone: string | null;
    customer: {
      id: string;
      email: string | null;
      firstName: string | null;
      lastName: string | null;
      displayName: string;
    } | null;
  };
  lines: { nodes: CartLine[] };
  cost: {
    subtotalAmount: Money;
    totalAmount: Money;
    totalDutyAmount: Money | null;
    totalTaxAmount: Money | null;
    subtotalAmountEstimated: boolean;
    totalTaxAmountEstimated: boolean;
  };
  discountCodes: { code: string; applicable: boolean }[];
  appliedGiftCards: { id: string; lastCharacters: string; amountUsed: Money; balance: Money }[];
  discountAllocations: DiscountAllocation[];
}

    ↑ ↓ to moveEnter to openEsc to close