Newer Version Available
Let us know so we can improve!
| 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:
1EVGProduct *product = [EVGproduct productWithId:@"B25787"
2 name:@"Road Runners"
3 price:@110.00
4 url:@"http://www.shoes4u.com/us/road-runners/B25787.html"
5 imageUrl:@"http://www.shoes4u.com/us/road-runners/B25787.png"
6 evgDescription:@"Road Runners shoes are great for running!"];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.
1@property (nullable, nonatomic, strong) NSNumber *priceOptional field for descriptive text for the price, e.g. ‘Sale Price’.
1@property (nullable, nonatomic, copy) NSString *priceDescriptionOptional field for capturing e.g. MSRP in order to illustrate discount.
1@property (nullable, nonatomic, strong) NSNumber *listPriceAn 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.
1@property (nullable, nonatomic, copy) NSString *currencyA count of available units. Alternatively, this may be simply 1 or 0 to indicate available or unavailable, respectively.
1@property (nullable, nonatomic, strong) NSNumber *inventoryCountAn identifier for a product other than the one stored in evgId.
1@property (nullable, nonatomic, copy) NSString *alternateIdBuilds an EVGProduct with the required id only.
1+ (nonnull instancetype)productWithId:(nonnull NSString *)evgIdParameters
| 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:].
1+ (nonnull instancetype)productWithId:(nonnull NSString *)evgId name:(nullable NSString *)name price:(nullable NSNumber *)price url:(nullable NSString *)url imageUrl:(nullable NSString *)imageUrl evgDescription:(nullable NSString *)evgDescriptionParameters
| 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.
1+ (nullable instancetype)productFromJSONDictionary:(nonnull NSDictionary<NSString*,id> *)jsonParameters
| Parameter | Description |
|---|---|
json | A product in JSON form |
Return Value
A product which can be further modified, or nil if JSON is invalid
Newer Version Available