Showing posts with the label SAP Hybris

How to add custom Sort By Option in Hybris?

Sometime you required to have custom Sort by options in your category or products listing page. In this post, I will explain you all required steps. 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.DefaultFacetSo

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 su - and enter …

Delete Hybris Products having duplicate name from HAC

How to delete duplicate product using the flexible search in Hybris?
Open HAC > console > scripting languages Now you can run the below groovy script 1. Groovy script to get the list of pks to be removed import; flexibleSearchService = spring.getBean("flexibleSearchService") modelService = spring.getBean("modelService") def findProductWithSameName() { query = """ select MIN({}) as pks from {Product! as p JOIN CatalogVersion as CV on {p.catalogversion}={CV:PK} and {CV:version} = 'Online' JOIN Catalog as C on {CV:catalog}={C:PK} and {C:id}='myProductCatalog' } group by {p:name} having count(*) > 1""";; } findProductWithSameName().each { println it.code; //modelService.remove(it); }
2. Test Remove scriptimport; flexibleSe…

SAP Hybris Installation and Deployment Architecture - [Part2]

If you not gone through Part1, then please read it first. Centralized logging Hybris OOTB there is centralized_logging recipes, which can be used if you have Docker base setup. Anyway, you can set up your own ELK Stack (Elasticsearch-Logstash-Kibana), which is a good combination as Log Management Solution (Open Source). You can use Redis for the large enterprise solution to decouple the Log Server & Log Shipper. Tools: Logstash: As a log shipper and a log indexerRedis: As a broker – used as a queuing systemElasticSearch: As a log indexer – store and index logsKibana: As a front-end viewer – a nice UI with useful extra featuresInstall & configured above stack to get consolidated logs from all application servers. Advanced Application Monitoring SAP Hybris Commerce Advanced Application Monitoring is a tool for analyzing network traffic within the Hybris system. Advanced Application Monitoring is vital for administrating and monitoring the health of live, deployed systems. You can…

How to support multiple toAddress CC BCC and attachments in hybris email?

Scenario We want to send email to multiple addresses, also want to support the email attachments. Unfortunately, it's not there in OOTB. Solution We have to define our custom attributes in BusinessProcess itemType to stores the values and access it in the later process. Also, we have to override generate method of DefaultEmailGenerationService, as it is responsible to generate EmailMessageModel. We will set attachments and other fields to generated emailMessageModel only. Let's see it step by step.

1) Define custom attribute in BusinessProcessModel To do so, you have to define attributes like below in your *-items.xml file. Now build your server(ant clean all), which will generate BusinessProcessModel with our custom attributes, which can be accessed using setter and getter methods.