PiCartItem

Package: com.salesforce.marketingcloud.analytics

SDK Version: 11.0.0

Overview 

1data class PiCartItem(
2    val item: String,
3    val quantity: Int,
4    val price: Double,
5    val uniqueId: String?
6) : Parcelable

A data class representing a cart content item, designed to be used as part of PiCart.cartItems.

Constructors 

Primary Constructor 

1constructor(
2    item: String,
3    quantity: Int,
4    price: Double,
5    uniqueId: String?
6)

Creates a PiCartItem with all parameters including an optional unique identifier.

Parameters:

  • item - The item name or identifier
  • quantity - The quantity of this item
  • price - The price of the item
  • uniqueId - Optional unique identifier for the item

Secondary Constructor 

1constructor(
2    item: String,
3    quantity: Int,
4    price: Double
5)

Creates a PiCartItem without a unique identifier (uniqueId will be null).

Parameters:

  • item - The item name or identifier
  • quantity - The quantity of this item
  • price - The price of the item

Properties 

item 

1@JvmField
2val item: String

The item name or identifier.

quantity 

1@JvmField
2val quantity: Int

The quantity of this item in the cart.

price 

1@JvmField
2val price: Double

The price of the item.

uniqueId 

1@JvmField
2val uniqueId: String?

Optional unique identifier for the cart item.

Inheritance 

Implements android.os.Parcelable for Android parcelization support.