Magento 1 - Add image on facets

Hello everyone,

I have to implement Algolia on a project and one of the need is to display pictogram for each facets.
Ex : For the color facets, add the color image next to the label.
how Is it possible ? Do I need to add custom data on Algolia indexer like products ?
Can you help me ?

Thanks you !


You could do it with special data indexed into your record. For instant adding something like

  color: {
    name: "Red",
    value: "#FF0000"

Then add it to your facets configuration and create a custom instant search widget to handle.

I think the easiest way to would be to use JavaScript or even CSS to style it.

For example:

.ais-refinement-list--label > input[value="Red"]: { ... }