cancel
Showing results for 
Search instead for 
Did you mean: 

How to hide a given category in the "shop by category" facet ?

Former Member
0 Kudos

We have configured a facet called "shop by category", It lists all the category names for the products from the search results.

We want to hide some categories from the "shop by category" facet.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Thanks Richard,

How do we give more than one value as root category in the below case. We have multiple root categories that need to be indexed

<bean id="electronicsBrandCategorySource" parent="abstractCategorySource">
    <property name="rootCategory" value="brands"/>
    <!-- 'brands' is the root of the brands hierarchy -->
</bean> 
Former Member
0 Kudos

If you wish to do this at indexing time then I would extend de.hybris.platform.commerceservices.search.solrfacetsearch.provider.CategorySource to exclude categories you wish to be hidden (perhaps with a flag on Category) and inject that into the value provider.

see yacceleratorcore-spring.xml for an example :

 <bean id="electronicsCategoryCodeValueProvider" parent="abstractCategoryCodeValueProvider">
         <property name="categorySource" ref="electronicsCategorySource"/>
     </bean>


Another option is to actually place these categories in a different category tree, and simply not export categories from the given root category (in electronics examples of root categories exported are 1 and brands).