Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

Product

Product

A Product domain object describes a purchasable item in the store, such as "Name: Canon PowerShot A80, Product Type: Camera, Brand: Canon, Release Date: March. 1 2012".

Products have SKUs (Stock Keeping Units), which represents a particular product configuration. For example, a silver Canon PowerShot A80. Products can have multiple SKUs that a customer can select. For information on the SKU selection process, see Guided Product Selection.

Product Properties

Product objects have the following properties:

Type Property Description
Date startDate The date the product becomes purchasable in the store.
Date endDate The date the products is no longer purchasable in the store.
Date lastModifiedDate The date when the product was last modified.
ProductType productType The product's collection of configurable SkuOptions.
Map<String, ProductSku> productSkus The purchasable variations (SKUs) of a product.
Set<ProductCategory> productCategories The categories the product belongs to.
Map<Locale, LocaleDependantFields> localeDependentFieldsMap The map of localeDependentFields . Used for SEO.
Brand brand The product's brand.
ProductSku defaultSku The product's default SKU.
String image The filename of the product's main image.
boolean hidden The indicator for whether a product is viewable in the store.
boolean notSoldSeparately The indicator for whether a product cannot be sold outside of bundles.
int salesCount The products total number of sales.
int minOrderQty The minimum quantity of the product that is purchasable.
AttributeValueGroup attributeValueGroup The wrapper for the attributeValueMap.
String code The user defined product code that uniquely identifies the product.
TaxCode taxCode The taxes to apply to the product.
Map<String, AttributeValue> attributeValueMap The map of product AttributeValues.
long uidPk The product's UID generated by OpenJPA.
Date expectedReleaseDate The date the product expects to be released.
AvailabilityCriteria availabilityCriteria The property for whether a product could be on sale depending on stock quantity.
int preOrBackOrderLimit The product's limit on pre orders and back orders.

Performance-sensitive, locale-dependent data

Products are performance-sensitive since they are the central object accessed when a customer browses the catalog. For this reason, product data that is specific to a particular locale is stored in a special object called LocaleDependantFields.

LocaleDependentFields objects contain the following data:

The LocaleDependentFields' locale.

Type Property Description
String URL The product's search engine optimized URL.
String displayName The product's name.
String keywords The product's search keywords.
String description The product's description.
String title The product's title.
Locale locale The LocaleDependentFields' locale.

To access the product's LocaleDependentFields' object for a particular locale, use the getLocaleDependantFields method on product.

Attributes

Business users can extend a product by using attributes. For example, you may have a megapixels attribute for digital cameras. For more information on Attributes, see Attributes.

Accessing product attributes

An attribute is accessible from a product by using the attribute key, as shown in the following examples:

String myStringAttribute = (String) product.getAttributeValueGroup().getAttributeValue("myStringAttributeValueKey", Locale).getValue();
Date myDateAttribute = (Date) product.getAttributeValueGroup().getAttributeValue("myDateAttributeValueKey", Locale).getValue();

The AttributeValueGroup interface defines a convenience method for automatically returning String attribute values:

String myStringAttribute = product.getAttributeValueGroup().getStringAttributeValue("attributeValueKey", Locale);