Class Recommendation

Represents a recommendation in Commerce Cloud Digital.

Constant Summary 

ConstantDescription
RECOMMENDATION_TYPE_CROSS_SELL: Number = 1Represents a cross-sell recommendation.
RECOMMENDATION_TYPE_OTHER: Number = 3Represents a recommendation that is neither a cross-sell or an up-sell.
RECOMMENDATION_TYPE_UP_SELL: Number = 2Represents an up-sell recommendation.

Property Summary 

PropertyDescription
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.

Constructor Summary 

This class does not have a constructor, so you cannot create it directly.

Method Summary 

MethodDescription
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.

Methods inherited from class ExtensibleObject 

describe, getCustom

Methods inherited from class PersistentObject 

getCreationDate, getLastModified, getUUID

Methods inherited from class Object 

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

Constant Details 

RECOMMENDATION_TYPE_CROSS_SELL 

RECOMMENDATION_TYPE_CROSS_SELL: Number = 1

Represents a cross-sell recommendation.

Deprecated:

Use the integer value instead. The recommendation types and their meanings are now configurable in the Business Manager.

Warning


RECOMMENDATION_TYPE_OTHER 

RECOMMENDATION_TYPE_OTHER: Number = 3

Represents 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.

Warning


RECOMMENDATION_TYPE_UP_SELL 

RECOMMENDATION_TYPE_UP_SELL: Number = 2

Represents an up-sell recommendation.

Deprecated:

Use the integer value instead. The recommendation types and their meanings are now configurable in the Business Manager.

Warning


Property Details 

calloutMsg 

calloutMsg: MarkupText (read-only)

Returns the recommendation's callout message in the current locale.


catalog 

catalog: Catalog (read-only)

Return the catalog containing the recommendation.


image 

image: MediaFile (read-only)

Returns the recommendation's image.


longDescription 

longDescription: MarkupText (read-only)

Returns the recommendation's long description in the current locale.


name 

name: String (read-only)

Returns the name of the recommended item in the current locale.


recommendationType 

recommendationType: Number (read-only)

Returns the type of the recommendation.


recommendedItem 

recommendedItem: Object (read-only)

Return a reference to the recommended item. This will always be an object of type dw.catalog.Product since this is the only currently supported recommendation target type.


recommendedItemID 

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 

shortDescription: MarkupText (read-only)

Returns the recommendation's short description in the current locale.


sourceItem 

sourceItem: Object (read-only)

Return a reference to the source item. This will be an object of type dw.catalog.Product or dw.catalog.Category.


sourceItemID 

sourceItemID: String (read-only)

Return the ID of the recommendation source item. This will either be a product ID or category name.


Method Details 

getCalloutMsg() 

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() 

getCatalog(): Catalog

Return the catalog containing the recommendation.

Returns:

  • the catalog containing the recommendation.

getImage() 

getImage(): MediaFile

Returns the recommendation's image.

Returns:

  • the recommendation's image.

getLongDescription() 

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() 

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() 

getRecommendationType(): Number

Returns the type of the recommendation.

Returns:

  • the type of the recommendation expressed as an integer.

getRecommendedItem() 

getRecommendedItem(): Object

Return a reference to the recommended item. This will always be an object of type dw.catalog.Product since this is the only currently supported recommendation target type.

Returns:

  • the recommended item, possibly null if the item does not exist.

getRecommendedItemID() 

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() 

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() 

getSourceItem(): Object

Return a reference to the source item. This will be an object of type dw.catalog.Product or dw.catalog.Category.

Returns:

  • the source item.

getSourceItemID() 

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.