@iterable/react-native-sdk - v2.0.3
    Preparing search index...

    Class IterableCommerceItem

    Represents an item for purchase.

    This is used in methods like trackPurchase to track purchases made by users. It is also used in the updateCart method to update the shopping cart.

    const commerceItem = new IterableCommerceItem(
    '12345',
    'Example Item',
    9.99,
    1,
    'SKU123',
    'An example item for demonstration purposes.',
    'https://example.com/item',
    'https://example.com/item.jpg',
    ['Example', 'Demo'],
    { customField: 'value' },
    );

    IterableAPI.updateCart([commerceItem]);
    Index

    Constructors

    • Creates an instance of IterableCommerceItem.

      Parameters

      • id: string

        The unique identifier for the item.

      • name: string

        The name of the item.

      • price: number

        The price of the item.

      • quantity: number

        The quantity of the item.

      • Optionalsku: string

        The stock keeping unit (SKU) of the item.

      • Optionaldescription: string

        The description of the item.

      • Optionalurl: string

        The URL of the item.

      • OptionalimageUrl: string

        The image URL of the item.

      • Optionalcategories: string[]

        The categories the item belongs to.

      • OptionaldataFields: unknown

        Additional data fields for the item.

      Returns IterableCommerceItem

      A new instance of IterableCommerceItem.

      const commerceItem = new IterableCommerceItem(
      '12345',
      'Example Item',
      9.99,
      1,
      'SKU123',
      'An example item for demonstration purposes.',
      'https://example.com/item',
      'https://example.com/item.jpg',
      ['Example', 'Demo'],
      { customField: 'value' },
      );

    Properties

    categories?: string[]

    The categories the item belongs to.

    dataFields?: unknown

    Additional data fields for the item.

    description?: string

    The description of the item.

    id: string

    The unique identifier for the item.

    imageUrl?: string

    The image URL of the item.

    name: string

    The name of the item.

    price: number

    The price of the item.

    quantity: number

    The quantity of the item.

    sku?: string

    The stock keeping unit (SKU) of the item.

    url?: string

    The URL of the item.