Recommendation
`ff-recommendation` retrieves recommended products and renders them through a nested `ff-record-list`. Configure product context, result limits, and personalization for each placement.
Documentation
Overview
With the ff-recommendation you can display a set of records which are presented to users based on their search history and their last purchased products as well as their product views.
The recommendation service learns the shopping behavior for each user and creates a list of records which can be displayed to them.
Inside the ff-recommendation element you define an ff-record-list to display the recommended products. This ff-record-list does not listen to the default search result and gets its records from the recommendation service.
<ff-recommendation>
<div class="recommendationHeader">Recommendations</div>
<ff-record-list subscribe="false">
<template data-role="record">
<ff-record>
<img data-image="{{variantValues.0.ImageName}}">
<div>
<a href="https://your.shop/{{variantValues.0.Deeplink}}">
{{variantValues.0.Title}}
</a>
<div>Price: <strong>{{$ variantValues.0.Price}}</strong></div>
</div>
</ff-record>
</template>
</ff-record-list>
</ff-recommendation>API
ff-recommendation
Properties
product-number (String, comma-separated list) (default: empty)
A comma-separated list used to return recommendations.
max-results (Number) (default: empty)
The maximum number of returned product recommendations.
use-personalization (String) Options: "true", "false" (default: "true")
When "false", recommendations load without personalization.
Methods
getRecommendations()
Refreshes recommendations using the current product-number value.
Attributes
max-results
The max-results attribute defines how many records should be loaded. By default, this value is empty and the element displays as many records as FactFinder returns.
product-number
product-number takes the value that is labeled with the productNumber field role.
This attribute takes a list of comma-separated values. Once set, ff-recommendation queries FactFinder for a list of recommendations based on the specified product numbers.
The displayed recommendations are refreshed every time the product-number HTML attribute or the corresponding productNumber JavaScript property are changed.
use-personalization
With the use-personalization attribute you can define whether the recommendations should use the personalization feature. The default value is true.
Last updated
Was this helpful?