Showing posts with the label hac

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…

How to block or prevent the system initialization in Hybris HAC?

Lock the system initialization: To lock the system for initialization and update add the unlocking (system.unlocking.disabled=true) properties to your file and rebuild your system. Unlock the system initialization: You can also unlock it without restarting the system. Set system.unlocking.disabled to false (HAC>configuration)Go to /hac/platform/init, Click on Unlock.Wiki reference
Block/Redirect URL from the web server: If you have web server in place for admin console, You can block or redirect /hac/platform/initURL to some dummy URL(/hac/platform/NOinit) from the web server itself. Do the google for your web server configuration for the same.
Change request mapping in Hybris HAC(Not recommend): HAC request mapping is done by