Posts

How to configure catalog sync cronjob in Hybris?

Image
 How to create custom catalog synchronization job in Hybris? Scenario My client wants to have product catalog sync cronjob. So the first thing that came to my mind was, It's quite easy, by creating an instance of  CatalogSyncCronJob  and assign it to appropriate sync job(Product Sync stage to Online) and trigger. But it won't work like that. CatalogVersionSyncJob is designed to run only once with each instance.  So if we create sync job instance by ImpEx/HMC, it will not get any newly / modified items in the second execution. because system needs a new instance for each sync execution! Wondering, how catalog synchronization works when we do it form Hybris HMC(Catalog Management Tool > Synchronization)? If we execute catalog sync from Catalog Management Tool, then each time, Hybris internally creates a new instance of selected sync job. Hence, it can detect new or modified items to sync. Solution We can write the custom job, which basically does t

How to redirect or forward request in Hybris?

What is basic difference between request Redirect Vs Forward? Redirect:  Server sends a header (in response) back to the browser/client, which contain redirect URL, then browser initiates a new request to redirect URL. Browser creates a new request to the redirected URL. The browser displays the redirected URL. The client browser is involved. Redirect is slower. When can we use Redirect? @RequestMapping(value = "/originalurl", method = {RequestMethod.POST}) public String method(final Model model) { // ... return "redirect:/redirectToGeturl"; } Usually, when data is posted to the server, we should redirect to get method(URL). So browser displays redirected URL(/redirectToGeturl). Which also prevent data resubmission on browser refreshed(F5) as the request to will go to redirected URL(/redirectToGeturl). Forward:  Within the server, control can be forwarded to target resource(URL). Which is done by container internally so browser/clie

How to add you custom class in HAC logging list?

Scenario Hybris use  log4j2 logger . We can change the log level for preconfigured classes from the HAC > Platform > Loggin (like root , org.springframework etc.). But what if we want to configure logger for our custom class. Solution Add logger statement in your java class add log4j2 configuration for your custom Java class Restart the Hybris server MyService.Java private static final Logger LOG = Logger.getLogger(MyService.class); LOG.debug("I am debug log"); local.properties \#log4j2 configuration log4j2.rootLogger.level = warn log4j2.logger.myService.name = com.extended.service.impl.MyService log4j2.logger.myService.level = warn log4j2.logger.myService.appenderRef.stdout.ref = STDOUT log4j2.logger.customService.name = com.extended.service.impl.CustomService log4j2.logger.customService.level = warn log4j2.logger.customService.appenderRef.stdout.ref = STDOUT Do you know this also can be done  without restarting Hybris server?

How to Integrate Google Enhanced Ecommerce with Hybris

How to implement Universal Analytics (UA) Enhanced Ecommerce features using Google Tag Manager on a Hybris? We already have successfully implemented Enhanced E-commerce (Integrating Google Analytics) for many of Hybris sites. This will be paid service. contact@helphybris.com