---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAECommerceCartItem.md
  - https://appmetrica.yandex.by/docs/ru/sdk/ios/analytics/objectivec/AMAECommerceCartItem.md
  - https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/objectivec/AMAECommerceCartItem.md
  - href: https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/objectivec/AMAECommerceCartItem.md
    type: text/markdown
    title: Markdown version
  - href: https://appmetrica.yandex.by/docs/zh/llms.txt?revision=r21874424
    rel: describedby
---
> **Documentation Index:** Fetch the complete configuration index at https://appmetrica.yandex.by/docs/zh/llms.txt?revision=r21874424

# AMAECommerceCartItem 类

此类包含关于添加到购物车的商品的信息。

## Instance methods {#instance_summary}

#|
|| [-使用产品初始化:数量:收入:推荐来源:](#method_initWithProduct__referrer__quantity__revenue) | 用购物车中添加的商品信息初始化 `AMAECommerceCartItem` 类的实例。 ||
|#

## Properties {#property_summary}

#|
|| [产品](#property_product) | Product. The `AMAECommerceProduct` 类实例。 ||
|| [数量](#property_quantity) | Quantity. ||
|| [收入](#property_revenue) | 购物车中商品的总价格。 这个价格考虑了数量、应应用的折扣等因素。 The `AMAECommercePrice` 类实例。 ||
|| [来源网站](#property_referrer) | 购物车的流量来源。 The `AMAECommerceReferrer` 类实例。 ||
|#

## Method descriptions {#method_detail}

### -初始化产品:引荐者:数量:收入: {#method_initWithProduct__referrer__quantity__revenue}

```objectivec translate=no
- (instancetype)initWithProduct:(AMAECommerceProduct *)product
                       quantity:(NSDecimalNumber *)quantity
                        revenue:(AMAECommercePrice *)revenue
                       referrer:(nullable AMAECommerceReferrer *)referrer;
```

用购物车中添加的商品信息初始化 `AMAECommerceCartItem` 类的实例。

**参数：**

#|
|| `产品` | Product. The `AMAECommerceProduct` 类实例。 ||
|| `数量` | Quantity. ||
|| `收入` | 购物车中商品的总价格。 这个价格考虑了数量、将应用的折扣等因素。 The `AMAECommercePrice` 类实例。 ||
|| `referrer` | 购物车的流量来源。 The `AMAECommerceReferrer` 类实例。 ||
|#

**返回：**

该 `AMAECommerceCartItem` 类实例。

## Property descriptions {#property_detail}

### product {#property_product}

`(nonatomic, strong, readonly) AMAECommerceProduct *产品`

Product. 该 `AMAECommerceProduct` 类实例。

### quantity {#property_quantity}

`(nonatomic, strong, readonly) NSDecimalNumber *数量`

Quantity.

### revenue {#property_revenue}

`(nonatomic, strong, readonly) AMAECommercePrice *收入`

购物车中商品的总价格。 这个价格考虑了数量、将应用的折扣等因素。 The `AMAECommercePrice` 类实例。

### referrer {#property_referrer}

`(nonatomic, strong, 只读, 可空) AMAECommerceReferrer *引用者`

购物车流量的来源。 The `AMAECommerceReferrer` 类实例。
