YMMECommerceProduct class

This class contains product information.

Instance methods

init(sku:)

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

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

Initializes the instance of the YMMECommerceProduct class with all parameters.

init(sku:)

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

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

Initializes the instance of the YMMECommerceProduct 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. Acceptable sizes:
  • Up to 10 elements.
  • The size of a single element is up to 100 characters.
payload
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

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.
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. Acceptable sizes:
  • Up to 10 elements.
  • The size of a single element is up to 100 characters.
payload
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

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.

Method descriptions

init(sku:)

init(sku: String)

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

Parameters:
sku

Item number. Allowed size: Up to 100 characters.

sku

Item number. Allowed size: Up to 100 characters.

Returns:

The YMMECommerceProduct class instance.

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

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

Initializes the instance of the YMMECommerceProduct 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. Acceptable sizes:
  • Up to 10 elements.
  • The size of a single element is up to 100 characters.
payload
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

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.
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. Acceptable sizes:
  • Up to 10 elements.
  • The size of a single element is up to 100 characters.
payload
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

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.

Returns:

The YMMECommerceProduct 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: YMMECommercePrice? { get }

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

originalPrice

var originalPrice: YMMECommercePrice? { 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.