---
metadata:
  - name: generator
    content: Diplodoc Platform v5.64.0
alternate:
  - https://appmetrica.yandex.by/docs/en/sdk/ios/analytics/objectivec/AMAECommerceProduct.md
  - https://appmetrica.yandex.by/docs/ru/sdk/ios/analytics/objectivec/AMAECommerceProduct.md
  - https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/objectivec/AMAECommerceProduct.md
  - href: https://appmetrica.yandex.by/docs/zh/sdk/ios/analytics/objectivec/AMAECommerceProduct.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

# AMAECommerceProduct 类

此类包含产品信息。

## Instance methods {#instance_summary}

#|
|| [-initWithSKU:](#method_initWithSKU) | 用指定的商品编号初始化 `AMAECommerceProduct` 类的实例。 ||
|| [-使用SKU初始化:名称:类别组件:负载:实际价格:原始价格:促销代码:](#method_initWithSKU__name__categoryComponents__payload__actualPrice__originalPrice__promoCodes) | 使用所有参数初始化 `AMAECommerceProduct` 类的实例。 ||
|#

## Properties {#property_summary}

#|
|| [sku](#property_sku) | 项目编号。 允许的大小：最多100个字符。 ||
|| [名称](#property_name) | 产品名称。 允许的大小：最多1000个字符。 ||
|| [categoryComponents](#property_categoryComponents) | 按类别显示产品的路径。 |
|| [payload](#property_payload) | Additional information about the product. ||
|| [actualPrice](#property_actualPrice) | The actual product price, which is the price after applying all discounts and promo codes. ||
|| [originalPrice](#property_originalPrice) | The initial product price. ||
|| [promoCodes](#property_promoCodes) | A list of promo codes that are applied to the product. ||
|#

## Method descriptions {#method_detail}

### -initWithSKU: {#method_initWithSKU}

```objectivec translate=no
- (instancetype)initWithSKU:(NSString *)sku
```

用指定的商品编号初始化 `AMAECommerceProduct` 类的实例。

**参数：**

#|
|| `sku` | 项目编号。 允许的大小：最多100个字符。 ||
|#

**返回：**

The `AMAECommerceProduct` 类实例。

### ‑initWithSKU:名称:类别组件:负载:实际价格:原始价格:促销代码: {#method_initWithSKU__name__categoryComponents__payload__actualPrice__originalPrice__promoCodes}

```objectivec translate=no
- (instancetype)initWithSKU:(NSString *)sku
                       name:(nullable NSString *)name
         categoryComponents:(nullable NSArray<NSString *> *)categoryComponents
                    payload:(nullable NSDictionary<NSString *, NSString *> *)payload
                actualPrice:(nullable AMAECommercePrice *)actualPrice
              originalPrice:(nullable AMAECommercePrice *)originalPrice
                 promoCodes:(nullable NSArray<NSString *> *)promoCodes;
```

使用所有参数初始化 `AMAECommerceProduct` 类的实例。

**参数：**

#|
|| `sku` | 项目编号。 允许的大小：最多100个字符。 ||
|| `名称` | 产品名称。 允许的大小：最多1000个字符。 ||
|| `categoryComponents` | 按类别查看产品的路径。 可接受的尺寸：

- 最多 10 个元素。
- 单个元素的大小最多为100个字符。 |
   || `payload` | Additional information about the order. Acceptable sizes:

- The total `payload` size: Up to 20 KB.
- The `key` size: Up to 100 characters.
- The `value` size: Up to 1000 characters. ||
   || `actualPrice` | The actual product price, which is the price after applying all discounts and promo codes. ||
   || `originalPrice` | The initial product price. ||
   || `promoCodes` | A list of promo codes that are applied to the product. Acceptable sizes:

- Up to 20 elements.
- The promo code length is up to 100 characters. ||
   |#

**返回：**

The `AMAECommerceProduct` 类实例。

## Property descriptions {#property_detail}

### sku {#property_sku}

`(非原子, 拷贝, 只读) NSString *sku`

项目编号。 允许的大小：最多100个字符。

### name {#property_name}

`(非原子化, 拷贝, 只读, 可为空) NSString *name`

产品名称。 允许的大小：最多1000个字符。

### categoryComponents {#property_categoryComponents}

`(非原子化, 拷贝, 只读, 可空) NSArray<NSString *> *categoryComponents`

按类别查看产品的路径。 可接受的大小：

- 最多10个元素。
- 单个元素的大小最多为100个字符。

### payload {#property_payload}

`(nonatomic, copy, readonly, nullable) NSDictionary<NSString *, NSString *> *负载`

产品的额外信息。 可接受的尺寸：

- 总 `负载` 大小：最多 20 KB。
- 键`的`长度：最多100个字符。
- 该`value` 大小: 最多1000个字符。

### actualPrice {#property_actualPrice}

`(nonatomic, strong, readonly, nullable) AMAECommercePrice *实际价格`

实际产品价格，即应用所有折扣和促销代码后的价格。

### originalPrice {#property_originalPrice}

`(非原子化, 强引用, 只读, 可为空) AMAECommercePrice *originalPrice`

产品的初始价格。

### promoCodes {#property_promoCodes}

`(非原子, 拷贝, 只读, 可为空) NSArray<NSString *> *promoCodes`

一个应用于产品的促销码列表。 可接受的大小：

- 最多 20 个元素。
- 促销码长度最多为100个字符。
