How to add custom Sort logic for Sort By in Hybris?
Sometimes you may be required to have custom sorting logic for Sort By options in your category or products listing page. In this post, I will explain to you all the required steps. All you need is to define custom SortProvider. I'm taking the example of sort by size. Note: This post is based on Hybris version V6.0 , facetSort(code) is deprecated in SolrIndexedProperty type so it might be removed from the latest release. Define your SortProvider( sizeAttributeSortProvider ) bean First, you need to define comparator class ( SizeAttributeComparator ) and bean definition for the same. Now declare sortProvider( sizeAttributeSortProvider ) bean as below which point to OOTB class ( DefaultFacetSortProvider ). <bean id="sizeAttributeSortProvider" class="de.hybris.platform.solrfacetsearch.config.impl.DefaultFacetSortProvider"> <property name="comparator" ref="sizeFacetAttributeComparator"/> </bean> <b