Product

A product is a CategorizedItem that can be sold to users. Products can be added to LineItem objects when they have been ordered by the user.

1public class Product
2extends CategorizedItem

Fields 

FieldDescriptionModifier and Type
alternateIdAn identifier for a product other than the one stored in Item.id.java.lang.String
currencyAn ISO 4217 currency code for the currency of this item’s price such as USD, EUR, GBP.java.lang.String
inventoryCountA count of available units.java.lang.Integer
listPriceOptional field for capturing another price, such as MSRP, in order to illustrate discount.java.lang.Double
priceThe unit price of the product.java.lang.Double
priceDescriptionOptional field for descriptive text for the price, such as the Sale Price.java.lang.String

Fields inherited from class CategorizedItem:

Fields inherited from class Item:

price 

1@Nullable
2public java.lang.Double 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 Context.viewItem(com.evergage.android.promote.Item) events.

All cart and order interactions involving LineItem requires each LineItem to have a price.

Note

priceDescription 

1@Nullable
2public java.lang.String priceDescription

Optional field for descriptive text for the price, such as the Sale Price.

listPrice 

1@Nullable
2public java.lang.Double listPrice

Optional field for capturing another price, such as MSRP, in order to illustrate discount.

currency 

1@Nullable
2public java.lang.String currency

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.

inventoryCount 

1@Nullable
2public java.lang.Integer inventoryCount

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

alternateId 

1@Nullable
2public java.lang.String alternateId

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

Constructors 

Product 

1public Product(@NonNull
2               java.lang.String id)

Builds a Product with the required id only. The product can then be further modified.

Parameters 

ParameterDescriptionRequired?
idSee Item.id.Yes

Methods 

MethodModifier and Type
fromJSONObject(org.json.JSONObject json, java.lang.String id)static Product

Methods inherited from class Item:

fromJSONObject 

1@Nullable
2public static Product fromJSONObject(@NonNull
3                                               org.json.JSONObject json,
4                                               @NonNull
5                                               java.lang.String id)