Similar Products
`ff-similar-products` retrieves products related to a specified product. Use a nested `ff-record-list` to render returned items and limit their count.
Documentation
Overview
With the ff-similar-products element you can display a list of products which are similar to a specified product.
Inside the ff-similar-products element you define an ff-record-list to display the similar products.
<ff-similar-products>
<div class="similarProductsHeader">Similar Products</div>
<ff-record-list subscribe="false">
<template data-role="record">
<ff-record>
<img data-image>
<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-similar-products>API
ff-similar-products
Properties
(* - required)
product-id* (String)
The product ID used to return similar products.
id-type* (String) Options: "id", "productNumber"
Determines the type of product-id.
max-results (Number) (default: empty)
The maximum number of returned similar products.
Methods
getSimilarProducts()
Refreshes similar products using the current product-id value.
Attributes
product-id and id-type
When the product-id attribute is set, and every time it changes, ff-similar-products queries the FactFinder API for products similar to the one specified.
The id-type attribute defines what type of ID product-id specifies. There are two possible values:
productNumberid
Both attributes are required in order to invoke a valid request to FactFinder.
max-results
The max-results attribute defines how many records the FactFinder API shall return at most. The default value is empty and the FactFinder API will return as many records as its own default value is set to.
Last updated
Was this helpful?