EVGProduct Class Reference

Inherits fromDeclared in
EVGCategorizedItem : EVGItem : NSObjectEVGItems.h

A product is an item that can be sold to users. Products can be added to EVGLineItem objects when they have been ordered by the user.

For more information, see productWithId:name:price:url:imageUrl:evgDescription:

Here is an example of EVGProduct initialization:

The unit price of the product. This is required when the product is being ordered but optional otherwise. For instance, if the product has variable pricing there may be no correct price for [EVGContext viewItem:] events.

Optional field for descriptive text for the price, e.g. ‘Sale Price’.

Optional field for capturing e.g. MSRP in order to illustrate discount.

An ISO 4217 currency code for the currency of this item’s price such as USD, EUR, GBP. If absent, the currency is assumed to be the dataset default currency.

A count of available units. Alternatively, this may be simply 1 or 0 to indicate available or unavailable, respectively.

An identifier for a product other than the one stored in evgId.

Builds an EVGProduct with the required id only.

Parameters

ParameterDescription
evgIdSee [EVGItem evgId]. This is the only required field.

Return Value

A product which can be further modified.

Builds an EVGProduct, including many of the commonly used fields. This method only builds a data object. To use it, pass it to one of the tracking methods like [EVGContext viewItem:].

Parameters

ParameterDescription
evgIdSee [EVGItem evgId]. This is the only required field.
nameThe name of the product. It should be provided whenever possible.
priceThe unit price of the product. This is required when the product is being ordered but optional otherwise. For instance, if the product has variable pricing there may be no correct price for -viewItem: events.
urlA URL where the user can view information about the product.
imageUrlA URL containing an image of the product.
evgDescriptionA text description of the product.

Return Value

A product which can be further modified.

Creates an EVGProduct from the provided JSON.

Parameters

ParameterDescription
jsonA product in JSON form

Return Value

A product which can be further modified, or nil if JSON is invalid