Posts

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

How to setup user account on linux systems for Hybris?

Why you should avoid running applications as root I've often come across posts on forums or other websites where you see people joking in such a manner about running/logging in as root as if it's something awful and everyone ought to know about it. However, there isn't much that a search reveals on the matter. It may be widely known to Linux experts, but I really don't know why. I remember always running as root when I first tried Linux years ago (Redhat and Mandrake) and don't remember running into any problems because of that. There are actually some distros that have a bright red background with alert signs all over it as wallpaper for the root user (SuSe?). I still use the "Administrator" account for regular use on my Windows installation and haven't ever run into any problems there either.  [source] How to create a User Account on Linux systems for Hybris Setup? Open a shell prompt. If you are not logged in as root, type the command

How to add or update Sort by Options in the Hybris?

Case1: Update/remove existing Sort by option If you are looking for update/remove existing Sort by option then you can do it by simply through hmc/backoffice/impex. Go to back-office  SolrIndexedType  and open your Indexed type Go to Solr Sorts tab: Here you can see the list of Sort By option which you can update/delete Case2: Add a custom Sort by option without custom sort logic In case if you want to add new custom Sort by option without any custom sorting logic then you can do it without changing any code. Let's assume I want a new sort by option based on  isPromotedProduct  (boolean) of the Product type. Just  follow the below steps... 1) Define SolrIndexedProperty You need to have SolrIndexedProperty for your attribute and you need to do Solr indexing to reflect its value in the Solr server. Here, I am assuming you know this part very well or you may already have SolrIndexedProperty defined. INSERT_UPDATE SolrIndexedProperty ; solrIndexedType(identifier)[un

[yjavac] 1. ERROR cannot be resolved to a type in Hybris?

Extensions can have dependencies on one another. While working with Hybris you come across a scenario, where you want to import a class from the different extension. The build only works if the required extension is available. Ensure the below steps to works it smoothly. Dependencies to Non-Platform(not located in  /platform/ext ) Extension The required extension should be there in  localextensions.xml Add the required extension in  extensioninfo.xml  (e.g  <requires-extension name="hmc"/> ) of the dependent extension In your eclipse(IDE), add required extension in  build path  of the dependent extension to resolve IDE dependecy. Note:  Adding required extension in IDE build path won't resolve extension dependency of your platform. It only resolved by  extensioninfo.xml Rebuild the system ( ant clean all ) Dependencies to Platform Extension By default, all extensions have the dependency on Platform extension(located at  /platform/ext ). There