Headless Docs
Latest (1.2.3)
Latest (1.2.3)
  • Overview
  • Change Log
  • General Steps
    • Update Prices on Page
    • Update ATC Events
      • Shopify Functions
      • Shopify Plus + Scripts
    • Preview Your Site
    • Lite Mode
  • Next.js Steps
    • Requirements
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Next.js - App Directory Configuraiton
    • Requirements
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Gatsby Steps
    • Requirements
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Pack Digital Steps
    • Requirements
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Shopify Hydrogen / Remix
    • Requirements
    • Update loader()
    • Add Intelligems Provider
    • Track Page Views
    • Update Prices on Page
    • Update ATC Events
    • Preview Your Site
  • Examples
    • Custom Events
    • Content Testing
    • Gift With Purchases
  • Reference
    • Providers
      • Provider Props
    • Components
      • Price Components
    • Hooks
      • Price Hooks
      • Offer Hooks
      • Track Hooks
      • Experience Hooks
      • Variation Hooks
      • Cart & Checkout Hooks
Powered by GitBook
On this page
  • useIgCart()
  • useIgCheckout()
  1. Reference
  2. Hooks

Cart & Checkout Hooks

useIgCart()

Use this hook if your site manages user carts through the Storefront Cart API.

Requires the cartId. The hook will add a cart attribute to each cart session.

Returns a wrapCustomAttributes Function. This function will add Intelligems-required line item properties to any existing line item properties.

interface WrapStorefrontItemCustomAttributesParams{
    productId: string;
    variantId: string;
    customAttributes?: {
        key: string;
        value: string;
    }[] | null;
};

interface WrapStorefrontItemCustomAttributesResponse {
    key: string;
    value: string;
}[];

const useIgCart: (cartOrCheckoutToken: string) => {
    wrapCustomAttributes: (options: WrapStorefrontItemCustomAttributesParams) => WrapStorefrontItemCustomAttributesResponse;
};

useIgCheckout()

Use this hook if your site manages user carts through the Storefront Checkout API.

Requires the checkoutId. The hook will add a checkout attribute to each checkout session.

Returns a wrapCustomAttributes Function. This function will add Intelligems-required line item properties to any existing line item properties.

PreviousVariation Hooks