EVGLineItem Class Reference

Inherits fromDeclared in
NSObjectEVGItems.h

Overview 

A line item contains a single EVGItem subclass and the quantity that were ordered.

Initialization 

Here is an example of how to initialize a single EVGLineItem:

1EVGLineItem *lineItem = [EVGLineItem lineItemWithProductId:@"product001" productName:@"Road Runner" price:@100 quantity:@2];

item 

The item being ordered, subclass of EVGItem.

1@property (nonnull, nonatomic, strong) EVGItem *item

quantity 

The quantity of the item being ordered. Defaults to 1

1@property (nullable, nonatomic, strong) NSNumber *quantity

lineItemWithItem:quantity: 

Builds a line item which contains one or more units of a product in an order. This method only builds a data object. To use it, pass it to one of the tracking methods like [EVGContext addToCart:].

1+ (nonnull instancetype)lineItemWithItem:(nonnull EVGItem *)item quantity:(nullable NSNumber *)quantity

Parameters

ParameterDescription
itemThe required EVGItem subclass being ordered
quantityThe optional quantity, defaults to 1

Return Value

A line item which can be further modified.

lineItemWithProductId:productName:price:quantity: 

Builds a line item which contains one or more units of a product in an order. This method only builds a data object. To use it, pass it to one of the tracking methods like [EVGContext addToCart:].

1+ (nonnull instancetype)lineItemWithProductId:(nonnull NSString *)productId productName:(nullable NSString *)productName price:(nullable NSNumber *)price quantity:(nullable NSNumber *)quantity

Parameters

ParameterDescription
productIdThe ID of the product in this line item. This is the only required field.
productNameThe name of the product. It should be provided whenever possible.
priceThe unit price of the product. The revenue for this line item will be price x quantity. This is required when the product is being ordered but optional otherwise.
quantityThe number of units of the product this line item represents.

Return Value

A line item which can be further modified.