Configurable products - where we are and where to go


we have spend endless discussions on the best handling of configurable products related to search. The following is what we came up with so far. Looking for feedback or where to go now:
Fundamental challenge is that we have lots of products which differ in various aspects. We currently have 2 configurable/super attributes: color and size.
Getting the UX in this case right is not straight forward: Sometimes you might want to show the family of products (e.g. the user is just getting an overview of what is available), sometimes you need to be very specific in the result (e.g. the user ist trying to find a product very specific for his usecase).
I think we managed to cover both:
When the user is just browsing around, we will show the configurable product. Technically this means the user has just facetd for category or manufacturer (maybe more attributes to be included in this list in the future).
As soon as the user starts to search more precisely, we switch to show the most relevant simple product (child).
Getting algolia to do that is not trivial, so I’ll share the general approach.

  1. Add 3 dummy attributes parent, sizes, colors (note the plural). Those are not used in any attribte set/product, but this approach is cleaner to get algolia to be able to handle those. They are set to retrievable, but not searchable. The super attributes color & size are set to searchable instead.
  2. Observer on algolia_after_create_product_object that stores the color&size attributes of all children of a familiy and the parent sku in each member of the family in the dummy attributes colors/sizes/parent. This basically means a getParent->getChildren exercise on each child/parent. For performance reasons (getting children/parent in magento is horribly expensive) we have a cache included.
  3. Set product index to distinct filtering for parent attribute: { “distinct”: true, “attributeForDistinct”: “parent” }
  4. Set product index ranking to include type_id (configurable/simple) in ascending order. This way, configurable product hits are prefered over simple (=children) one, when looking for the member of a family to return. Note that due to enabling distinct only one member of a family is returned.
  5. Modify hit template modified to show the number of colors/sizes of a product with a hoover/popup.
  6. Add some clever JS to search page. This monitors search helper change event and will add a disjunctivefacetRefinement on type_id for simple as soon as the user starts to search/filter/facet. In order to make this work on page load, a custom widget’s init method does this as well (looks like you have no chance to get an event from the urlsync setting facets). Also this will hide this facet from the current filter list by using a custom widget.

We are quite happy (check with the result, will need a proper icon for the sizes popup…


Hello @alex1 !
Thanks a lot for sharing your investigation about configurable products !
I add this to our backlog and the team will look at it to see if it can help us to improve the way we display configurable products.

Thanks again.