Class Recommendation
Represents a recommendation in Commerce Cloud Digital.
| Constant | Description |
|---|---|
| Represents a cross-sell recommendation. | |
| Represents a recommendation that is neither a cross-sell or an up-sell. | |
| Represents an up-sell recommendation. |
| Property | Description |
|---|---|
calloutMsg: MarkupText (read-only) | Returns the recommendation's callout message in the current locale. |
catalog: Catalog (read-only) | Return the catalog containing the recommendation. |
image: MediaFile (read-only) | Returns the recommendation's image. |
longDescription: MarkupText (read-only) | Returns the recommendation's long description in the current locale. |
name: String (read-only) | Returns the name of the recommended item in the current locale. |
recommendationType: Number (read-only) | Returns the type of the recommendation. |
recommendedItem: Object (read-only) | Return a reference to the recommended item. |
recommendedItemID: String (read-only) | Return the ID of the recommended item. |
shortDescription: MarkupText (read-only) | Returns the recommendation's short description in the current locale. |
sourceItem: Object (read-only) | Return a reference to the source item. |
sourceItemID: String (read-only) | Return the ID of the recommendation source item. |
This class does not have a constructor, so you cannot create it directly.
| Method | Description |
|---|---|
| getCalloutMsg() | Returns the recommendation's callout message in the current locale. |
| getCatalog() | Return the catalog containing the recommendation. |
| getImage() | Returns the recommendation's image. |
| getLongDescription() | Returns the recommendation's long description in the current locale. |
| getName() | Returns the name of the recommended item in the current locale. |
| getRecommendationType() | Returns the type of the recommendation. |
| getRecommendedItem() | Return a reference to the recommended item. |
| getRecommendedItemID() | Return the ID of the recommended item. |
| getShortDescription() | Returns the recommendation's short description in the current locale. |
| getSourceItem() | Return a reference to the source item. |
| getSourceItemID() | Return the ID of the recommendation source item. |
getCreationDate, getLastModified, getUUID
assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values
RECOMMENDATION_TYPE_CROSS_SELL: Number = 1Represents a cross-sell recommendation.
Deprecated:
Use the integer value instead. The recommendation types and their meanings are now configurable in the Business Manager.
RECOMMENDATION_TYPE_OTHER: Number = 3Represents a recommendation that is neither a cross-sell or an up-sell.
Deprecated:
Use the integer value instead. The recommendation types and their meanings are now configurable in the Business Manager.
RECOMMENDATION_TYPE_UP_SELL: Number = 2Represents an up-sell recommendation.
Deprecated:
Use the integer value instead. The recommendation types and their meanings are now configurable in the Business Manager.
- calloutMsg: MarkupText
(read-only) Returns the recommendation's callout message in the current locale.
- catalog: Catalog
(read-only) Return the catalog containing the recommendation.
- image: MediaFile
(read-only) Returns the recommendation's image.
- longDescription: MarkupText
(read-only) Returns the recommendation's long description in the current locale.
- name: String
(read-only) Returns the name of the recommended item in the current locale.
- recommendationType: Number
(read-only) Returns the type of the recommendation.
- recommendedItem: Object
(read-only) Return a reference to the recommended item. This will always be an object of type
dw.catalog.Productsince this is the only currently supported recommendation target type.
- recommendedItemID: String
(read-only) Return the ID of the recommended item. This will always be a product ID since this is the only currently supported recommendation target type.
- shortDescription: MarkupText
(read-only) Returns the recommendation's short description in the current locale.
- sourceItem: Object
(read-only) Return a reference to the source item. This will be an object of type
dw.catalog.Productordw.catalog.Category.
- sourceItemID: String
(read-only) Return the ID of the recommendation source item. This will either be a product ID or category name.
- getCalloutMsg(): MarkupText
Returns the recommendation's callout message in the current locale.
Returns:
- the recommendation's callout message in the current locale, or null if it wasn't found.
- getCatalog(): Catalog
Return the catalog containing the recommendation.
Returns:
- the catalog containing the recommendation.
- getImage(): MediaFile
Returns the recommendation's image.
Returns:
- the recommendation's image.
- getLongDescription(): MarkupText
Returns the recommendation's long description in the current locale.
Returns:
- The recommendation's long description in the current locale, or null if it wasn't found.
- getName(): String
Returns the name of the recommended item in the current locale.
Returns:
- The name of the recommended item for the current locale, or null if it wasn't found.
- getRecommendationType(): Number
Returns the type of the recommendation.
Returns:
- the type of the recommendation expressed as an integer.
- getRecommendedItem(): Object
Return a reference to the recommended item. This will always be an object of type
dw.catalog.Productsince this is the only currently supported recommendation target type.Returns:
- the recommended item, possibly null if the item does not exist.
- getRecommendedItemID(): String
Return the ID of the recommended item. This will always be a product ID since this is the only currently supported recommendation target type.
Returns:
- the recommended item ID.
- getShortDescription(): MarkupText
Returns the recommendation's short description in the current locale.
Returns:
- the recommendations's short description in the current locale, or null if it wasn't found.
- getSourceItem(): Object
Return a reference to the source item. This will be an object of type
dw.catalog.Productordw.catalog.Category.Returns:
- the source item.
- getSourceItemID(): String
Return the ID of the recommendation source item. This will either be a product ID or category name.
Returns:
- the source item ID.