Skip to content

Ignore Bundle Product Child attributes in Layered Navigation

We have a part compatibility attribute on our website. We use it to let customers filter to only see parts that would be compatible for them.

The problem comes with Bundle products. We have the attribute on the bundle product set to show their compatibility but layered navigation is ignoring that and instead showing any bundle product that has a child product that is compatible.

I had a look at how Magento is generating it’s eav index table ‘catalog_product_index_eav’ and tried changing it so it doesn’t index child attributes.

I made the change to the following file and I was able to get it to stop indexing the child eav attribute in the above table. But it is still showing the bundle parents on the category page.

MagentoCatalogModelIndexerProductEavAbstractAction.php
    protected function processRelations(AbstractEav $indexer, array $ids, bool $onlyParents = false)
    {
        return $ids; //  line 166 add this change to not index child products

I think this is because it is getting this data from elasticsearch. I am not sure where elasticsearch is indexing the child product relations and their attributes.

I did find a question similar to this but it is for Magento 1 without elasticsearch link

Magento Version:

  • Magento 2.4.6-p4 Cloud Edition

  • Elasticsearch 7