EVGProduct Class Reference
Inherits from | Declared in |
---|---|
EVGCategorizedItem : EVGItem : NSObject | EVGItems.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
Parameter | Description |
---|---|
evgId | See [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
Parameter | Description |
---|---|
evgId | See [EVGItem evgId] . This is the only required field. |
name | The name of the product. It should be provided whenever possible. |
price | 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 -viewItem: events. |
url | A URL where the user can view information about the product. |
imageUrl | A URL containing an image of the product. |
evgDescription | A text description of the product. |
Return Value
A product which can be further modified.
Creates an EVGProduct
from the provided JSON.
Parameters
Parameter | Description |
---|---|
json | A product in JSON form |
Return Value
A product which can be further modified, or nil if JSON is invalid