Class ItemRecommendation
Object
ItemRecommendation
- All Implemented Interfaces:
Serializable
Represents a scored item recommendation calculated by logic. Intended for use in Cross-sell and up-sell.
Create an instance with api.newItemRecommendation(id, score). A recommendation logic
returns the instances it builds. The higher the score, the more relevant the item.
Example:
return [
api.newItemRecommendation("SKU-100", 0.92),
api.newItemRecommendation("SKU-200", 0.47)
]
- Since:
- 5.0 - Collins
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionItemRecommendation(String id, Double score) Creates a recommendation for one item. -
Method Summary
-
Constructor Details
-
ItemRecommendation
Creates a recommendation for one item.- Parameters:
id- Item ID, for example a Stock Keeping Unit (SKU). An entry with this ID must be present in the Master Data.score- Relevancy score. The higher the score, the more relevant the item.
-
-
Method Details
-
getId
Returns the ID of the recommended item.- Returns:
- The item ID, for example a SKU.
-
setId
Sets the ID of the recommended item.- Parameters:
id- Item ID, for example a Stock Keeping Unit (SKU). An entry with this ID must be present in the Master Data.
-
getScore
Returns the relevancy score of the recommended item.- Returns:
- The relevancy score. The higher the score, the more relevant the item.
-
setScore
Sets the relevancy score of the recommended item.- Parameters:
score- Relevancy score. The higher the score, the more relevant the item.
-
toString
-