Script: Class dw.catalog.Recommendation
Class Recommendation
- Object
- dw.object.PersistentObject
- dw.object.ExtensibleObject
- dw.catalog.Recommendation
- dw.object.ExtensibleObject
- dw.object.PersistentObject
Represents a recommendation in Commerce Cloud Digital.
Constants
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.
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.
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.
Properties
calloutMsg : MarkupText Read Only
The recommendation's callout message in the current locale.
catalog : Catalog Read Only
Return the catalog containing the recommendation.
image : MediaFile Read Only
The recommendation's image.
longDescription : MarkupText Read Only
The recommendation's long description in the current locale.
name : String Read Only
The name of the recommended item in the current locale.
recommendationType : Number Read Only
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.Product
since 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
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.Product
or dw.catalog.Category.
sourceItemID : String Read Only
Return the ID of the recommendation source item. This will either be a product ID or category name.
Constructor Summary
This class does not have a constructor, so you cannot create it directly.
Method Summary
Returns the recommendation's callout message in the current locale.
getCatalog() : Catalog
Return the catalog containing the recommendation.
Returns the recommendation's image.
getLongDescription() : MarkupText
Returns the recommendation's long description in the current locale.
Returns the name of the recommended item in the current locale.
getRecommendationType() : Number
Returns the type of the recommendation.
Return a reference to the recommended item.
getRecommendedItemID() : String
Return the ID of the recommended item.
getShortDescription() : MarkupText
Returns the recommendation's short description in the current locale.
getSourceItem() : Object
Return a reference to the source item.
Return the ID of the recommendation source item.
Methods inherited from class ExtensibleObject
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
Method Detail
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.