ECommerceProduct class

This class contains product information.

Instance methods

init(sku:)

Initializes the instance of the ECommerceProduct class with the specified item number.

init(sku:name:categoryComponents:payload:actualPrice:originalPrice:promoCodes:)

Initializes the instance of the ECommerceProduct class with all parameters.

Properties

sku

Item number. Allowed size: Up to 100 characters.

name

Name of the product. Allowed size: Up to 1000 characters.

categoryComponents

The path to the product by category.

Method descriptions

init(sku:)

init(sku: String)

Initializes the instance of the ECommerceProduct class with the specified item number.

Parameters:

sku

Item number. Allowed size: Up to 100 characters.

Returns:

The ECommerceProduct class instance.

init(sku:name:categoryComponents:payload:actualPrice:originalPrice:promoCodes:)

init(sku: String, name: String?, categoryComponents: [String]?, payload: [String, String]?, actualPrice: ECommercePrice?, originalPrice: ECommercePrice?, promoCodes: [String]?)

Initializes the instance of the ECommerceProduct class with all parameters.

Parameters:

sku

Item number. Allowed size: Up to 100 characters.

name

Name of the product. Allowed size: Up to 1000 characters.

categoryComponents

The path to the product by category.

Returns:

The ECommerceProduct class instance.

Property descriptions

sku

var sku: String { get }

Item number. Allowed size: Up to 100 characters.

name

var name: String? { get }

Name of the product. Allowed size: Up to 1000 characters.

categoryComponents

var categoryComponents: [String]? { get }

The path to the product by category. Acceptable sizes:

  • Up to 10 elements.
  • The size of a single element is up to 100 characters.

payload

var payload: [String : String]? { get }

Additional information about the product. 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

var actualPrice: ECommercePrice? { get }

The actual product price, which is the price after applying all discounts and promo codes.

originalPrice

var originalPrice: ECommercePrice? { get }

The initial product price.

promoCodes

var promoCodes: [String]? { get }

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.